<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
a = input ()
b = 0

if 1 <= a <= 18257 :

    while a != 0 :
    
        c = ( a - 1 ) * 12
        b += c
        a -= 1
    
    print b + 1
        