URI Online Judge | 2149

The Uncle Phill Bonati's Sequence

By Ricardo Martins, IFSULDEMINAS BR Brazil

Timelimit: 1

Will Bonati live in the city of Belo Air, along with the family of his uncle, Phill Bonati . Will usually does some things that his uncle did not like, such as, for example, listen to music at high volume. One day, Phill poses a challenge to his nephew. He would spend the first numbers of a sequence he created. If Will could find the next number in this sequence, his uncle would have to put up with his music, with high volume, and still make a soup for them. If not discovered, Will would have to stop listening to such songs, leaving the quieter uncle. The first numbers of this sequence are below. Will asked for your help to write a program that can identify the next number in this sequence .

0       1       1       1       2       2       4       8       12

Write a program that, given an integer, tell what is the value corresponding to this position in the proposed sequence.

Input

There will be several test cases. Each test case starts with an integer N ( 1 ≤ N ≤ 17), indicating the position requested in sequence. The entry ends with end of file.

Output

For each test case, print the amount corresponding to requested position in the sequence.

Input Sample Output Sample

1

4

10

0

1

96