K = int(input()) if K < 2: print(6) else: print(4*K**2+2)