K=int(input()) print(4*K*K+2)