URI Online Judge | 1639
# Generate Random Numbers

**Timelimit: 1**

Local Contest, University of Ulm Germany

John von Neumann suggested in 1946 a method to create a sequence of pseudo-random numbers. His idea is known as the "middle-square"-method and works as follows: We choose an initial value **a _{0}**, which has a decimal representation of length at most

Example 1: **a _{0}**=5555,

Example 2: **a _{0}**=1111,

Unfortunately, this random number generator is not very good. When started with an initial value it does not produce all other numbers with the same number of digits.

Your task is to check for a given initial value **a _{0}** how many different numbers are produced.

The input contains several test cases. Each test case consists of one line containing **a _{0}** (0 <

**Obs.:** Note that the third test case has the maximum number of different values among all possible inputs.

For each test case, print a line containing the number of different values **a _{i}** produced by this random number generator when started with the given value

Sample Input | Sample Output |

5555 |
32 |