def cal(n): a=(n*(n-1))+1 sum=a for i in range(n-1): a=a+2 sum=sum+a return sum n=int(input()) print(cal(n))