K = int(input()) if K>=2: print(4*K*K+2) else: print(1)