The following languages are only available languages for the problems from the contest

Surprise Language Round #7:

- FALSE

Virtual contest is a way to take part in past contest, as close as possible to participation on time. It is supported only ACM-ICPC mode for virtual contests.
If you've seen these problems, a virtual contest is not for you - solve these problems in the archive.
If you just want to solve some problem from a contest, a virtual contest is not for you - solve this problem in the archive.
Never use someone else's code, read the tutorials or communicate with other person during a virtual contest.

No tag edit access

A. Crystal Ball Sequence

time limit per test

2 secondsmemory limit per test

256 megabytesinput

standard inputoutput

standard outputCrystal 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 *H*_{n} = 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.

Examples

Input

1

Output

7

Input

3

Output

37

Codeforces (c) Copyright 2010-2019 Mike Mirzayanov

The only programming contests Web 2.0 platform

Server time: Mar/20/2019 19:30:56 (f2).

Desktop version, switch to mobile version.

Supported by

User lists

Name |
---|