while True:
    try:
        n = int(input())
        a1=2
        d= 3

        s = n*a1+n*(n-1)*d/2
        print(int(s))
    except:
        break