K = int(input())

if K == 0:
    print(1)
else:
    print(4 * K * K + 2)