404394: GYM101492 K Cutting Strings

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

Description

K. Cutting Stringstime limit per test2 secondsmemory limit per test512 megabytesinputstandard inputoutputstandard output

Alice, Beto, and Carlos are playing with twine. Alice starts by pulling taut the string of twine, then she folds it and holds the string at the fold. Beto holds the loose ends on the other side. They then repeat the following procedure. Carlos cuts the string with scissors, thus separating Alice and Beto. Alice, without letting go of the strings she was holding, grabs the loose ends of the strings held by Beto and he does the same to the loose ends of the strings held by Alice.

How many separate strings will they have after the procedure is repeated K times?

Input

The input has a single integer, K.

  • 0 ≤ K ≤ 30
Output

The output has a single integer, the amount of separate strings at the end of the process.

ExamplesInput
0
Output
1
Input
1
Output
3

Source/Category

加入题单

上一题 下一题 算法标签: