App Rating

No attempts yetTime limit1sMemory limit128 MB

Problem

The App Store lets users rate an app. Each user gives it from 1 to 5 stars, and the App Store shows the average of all the ratings that have been submitted.

For example, if three users gave 3, 4, and 4 stars, the average rating is $\frac{3 + 4 + 4}{3} = 3.67$. (The value is rounded at the third decimal place, leaving two decimals.)

As another example, suppose 126 people rated an app: 53 gave 5 stars, 18 gave 4 stars, 11 gave 3 stars, 16 gave 2 stars, and 28 gave 1 star. Then the average rating is $\frac{53 \times 5 + 18 \times 4 + 11 \times 3 + 16 \times 2 + 28 \times 1}{126} = 3.4126984$. (The value is rounded at the eighth decimal place, leaving seven decimals.)

For every app he built, Sanggeun stored the number of people who rated it, how many people gave each star count, and the average rating to $n$ decimal places ($0 < n < 9$). One day someone hacked his database and deleted everything except the average rating.

Only the average rating remains. Using it, write a program that finds the minimum number of people who could have rated the app to produce that exact average rating.

Input

The input consists of several lines (at most 2000 lines). Each line contains an average rating $v$ ($1 \le v \le 5$) given as a decimal. The fractional part of $v$ has at least one and at most eight digits, and this number of decimal digits is $n$. In other words, $v$ is the true average rounded at the $(n+1)$-th decimal place.

The last line contains a negative number and must not be processed.

Output

For the $i$-th average rating in the input, print the minimum number of people needed to produce it, one per line, in the format Case i: k.