A number sequence is defined as follows:
S(1)=1, S(2)=11, S(3)=21, S(4)=1211, S(5)=111221, S(6)=312211,
You are required to determine the length of .
The input consists of multiple test cases. Each test case contains a single integer (1 \leq n \leq 30) on a separate line. The last line contains n = 0 and should not be processed.
For each test case, output the length of on a separate line.
Example 1