while True:
try:
q = int(input())
a1 = -4
d = 6
www = q - 1
ans = a1 + d * www
print(ans)
except EOFError:
break