Midpoint Displacement Algorithm

Time limit1sMemory limit128 MB

Problem

Sanggeun wants to shoot a science-fiction movie with his friends. The movie needs alien terrain, but since they cannot actually fly a spaceship to an alien planet to film it, they will create the terrain with computer graphics.

The alien terrain is generated using the midpoint displacement algorithm.

To start the algorithm, Sanggeun chooses 4 points that form a square. Then, for each square, the terrain is subdivided by the following process:

  1. Add one point at the middle of each side of the square.
  2. Add one point at the center of the square.

Applying this process once to the initial state splits it into 4 squares. Sanggeun repeats the same process on every newly created square until he is satisfied.

The pictures below show the state after the process has been applied up to 2 times.

Initial state - 4 pointsAfter 1 time - 9 pointsAfter 2 times - 25 points

Sanggeun realized that a single point can belong to more than one square. To save memory, he stores each shared point only once. Write a program that finds how many distinct points must be stored after the process has been applied N times.

Input

The first line contains an integer N. (1 ≤ N ≤ 15)

Output

Print, on the first line, the number of distinct points that must be stored after the process has been applied N times.