Eli's Curious Experiment

Count the maximal independent sets of a path on N vertices that have size at least two, for many N up to 76, labeled by test case number.

Medium6Dynamic programmingCombinatoricsRecursionNo attempts yetTime limit3sMemory limit512 MB

Problem

Eli is a student who loves chemistry and recently joined a chemistry lab. There are NN test tubes in a row, numbered 1,2,,N1, 2, \dots, N from the left. Eli chooses some of the tubes and mixes them into one mixture. A mixture must satisfy both rules below.

  1. Never choose two tubes whose numbers are adjacent.
  2. No more tubes can be added without breaking rule 1. That is, every unchosen tube is adjacent to at least one chosen tube.

A choice of only one tube does not count as a mixture, so singletons are not counted.

For example, for N=5N = 5 the valid mixtures are {1,3,5}\{1, 3, 5\}, {2,4}\{2, 4\}, {2,5}\{2, 5\}, and {1,4}\{1, 4\}, which is 44 in total. {1,3}\{1, 3\} does not count because tube 55 can still be added without breaking rule 1, so it violates rule 2.

For each given number NN of tubes, compute the number of different mixtures satisfying the rules.

Input

The input consists of multiple test cases. Each test case is a single integer NN on its own line, with 1N761 \le N \le 76. The last line contains a single 00, which terminates the input and is not processed.

Output

For each test case, in the order given, print one line. If the answer to the kk-th test case is AA, print Case #k: A. Every answer is smaller than 2312^{31}.