302438: CF470A. Crystal Ball Sequence

Memory Limit:256 MB Time Limit:2 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

A. Crystal Ball Sequencetime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard output

Crystal ball sequence on hexagonal lattice is defined as follows: n-th element is the number of lattice points inside a hexagon with (n + 1) points on each side. The formula is Hn = 3·n·(n + 1) + 1. You are given n; calculate n-th element of the sequence.

Input

The only line of input contains an integer n (0 ≤ n ≤ 9).

Output

Output the n-th element of crystal ball sequence.

ExamplesInput
1
Output
7
Input
3
Output
37

Input

加入题单

上一题 下一题 算法标签: