t=int(input()) s=t*t-t+1 sum=0 for i in range(t): sum+=s s+=2 print (sum)