<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
def suma (i,j):
    if j<i:
        return 0
    return ((i+j)*(j-i+1))//2

def odpowiedz(n):
    return 1+12*suma(1,n-1)


txt = raw_input()
n = int(txt)
print odpowiedz(n)

