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