#RELAYF. 3分割ゲーム

3分割ゲーム

Score : 100100 points

Problem Statement

We have a cord whose length is a positive integer. We will perform the following condition until the length of the cord becomes at most 22:

  • Operation: Cut the rope at two positions to obtain three cords, each with a length of a positive integer. Among these, discard one with the longest length and one with the shortest length, and keep the remaining one.

Let f(N)f(N) be the maximum possible number of times to perform this operation, starting with a cord with the length NN.

You are given a positive integer XX. Find the maximum integer NN such that f(N)=Xf(N)=X.

Constraints

  • 1X401 \leq X \leq 40

Input

The input is given from Standard Input in the following format:

XX

Output

Print the value of the maximum integer NN such that f(N)=Xf(N)=X.

2
14