<image>

Input

The input contains a single integer a (1 ≤ a ≤ 18257).

Output

Print a single integer output (1 ≤ output ≤ 2·109).

Examples

Input

2


Output

13
#!/usr/bin/python

import sys
import math

def num(x):
    return (x - 1) * 2 * 6

n = int((sys.stdin.readline()).strip())

if n <= 0:
    print "Error n=%d" % n
    quit(-1)

if n == 1:
    print "1"
    quit()

result = 1
for i in range(2, n+1):
    result += num(i)

print result
quit()

        
