w = int(input())
b = [2]
a = 2
for i in range(1,w):
    a = a + 3
    b.append(a)
print(sum(b))