w = int(input())
wn = 2
a = 2
def func(n):
    global a
    global wn
    if n == 1:
        return a
    wn = wn + 3
    a = a + wn
    return func(n-1)
    
print(func(w))