After a probationary period in the game development company of IT City Petya was included in a group of the programmers that develops a new turn-based strategy game resembling the well known "Heroes of Might & Magic". A part of the game is turn-based fights of big squadrons of enemies on infinite fields where every cell is in form of a hexagon.

Some of magic effects are able to affect several field cells at once, cells that are situated not farther than n cells away from the cell in which the effect was applied. The distance between cells is the minimum number of cell border crosses on a path from one cell to another.

It is easy to see that the number of cells affected by a magic effect grows rapidly when n increases, so it can adversely affect the game performance. That's why Petya decided to write a program that can, given n, determine the number of cells that should be repainted after effect application, so that game designers can balance scale of the effects and the game performance. Help him to do it. Find the number of hexagons situated not farther than n cells away from a given cell. [Image] 


-----Input-----

The only line of the input contains one integer n (0 ≤ n ≤ 10^9).


-----Output-----

Output one integer — the number of hexagons situated not farther than n cells away from a given cell.


-----Examples-----
Input
2

Output
19

Difficulty: interview

Starter code:

Solutions:
n = int(input())
print(3*n*(n+1)+1)

n=int(input())
print((3*n*n)+3*n+1)


n = int(input())
print(1 + 6 * n * (n + 1) // 2)


n = int(input())
print(3*n*(n+1) + 1)


n = int(input())
res = 1
res += ((12 + 6 * (n - 1)) * n) // 2
print(res)

n = int(input())
print(1 + 6 * n * (n + 1) //2)


n = int(input())
print(n*(n+1)//2*6+1)

n = int(input())
sum = n * (n + 1) // 2
ans = sum * 6 + 1
print(ans)

n = int(input())
print(3 * n * (n + 1) + 1)


n = int(input())
print(6 * (n * (n + 1) // 2) + 1)


import re, sys, string, operator, functools, fractions, collections
sys.setrecursionlimit(10**7)
dX= [-1, 1, 0, 0,-1, 1,-1, 1]
dY= [ 0, 0,-1, 1, 1,-1,-1, 1]
RI=lambda x=' ': list(map(int,input().split(x)))
RS=lambda x=' ': input().rstrip().split(x)
mod=int(1e9+7)
eps=1e-6
#################################################
n=RI()[0]
print(3*n*(n+1) + 1)







c = 0
n = int(input())
print(6 * (n * (n + 1) // 2) + 1)


3

n = int(input())

ans = 3*n*(n+1)+1

print(str(ans))


x = int(input())
#x, y = map(int, input().split())

print((1+x)*x*3+1)

n = int(input())
print(1 + 3 * n * (n + 1))

n=int(input())
print((n+1)*(n+2)*3-6*(n+1)+1)


n=int(input())
print(3*n*(n+1) + 1)





n = int(input())
print(3*(n+1)*n+1)


def __starting_point():

    n = int(input())

    if n == 0:
        print(1)
    else:
        print(1+3*n*(n+1))
__starting_point()

n = int(input())
print(int((6*n+6)*n//2+1))


n = int(input())
print(3 * n * (n + 1) + 1)

def s(n):
    a1 = 0
    n += 1
    d = 6
    an = a1 + d * (n - 1)
    return (a1 + an) // 2 * n

print(s(int(input())) + 1)


n = int(input())
print(n * (n + 1) * 3 + 1)

n=int(input())
s=6*((n*(n+1))//2)+1
print(s)