문제2250--TRAILING SIFAR

2250: TRAILING SIFAR

실행시간 제한: 10 Sec  메모리사용 제한: 128 MB
제출: 1  통과: 1
[제출] [채점기록] [묻고답하기]

문제 설명

Sifar is a malay word for zero or 0. In mathematics, trailing sifar is a sequence of 0s in the decimal representation of a number after which no other digits follow.

The number of trailing sifar in the decimal representation of N! (5 <= N <= 1,000,000) is simply the multiplicity of the prime factor 5 in N!. Given a decimal integer N, you are to find the number of trailing sifar for N! For example, 10! = 3,628,800. Thus, the number of trailing sifar for 10! is 2.

입력 설명

Each line of input contains an integer N where 5 <= N <= 1,000,000. The input is terminated with a line containing 0.

출력 설명

For each test case, the output contains a line in the format Case #x: M, where x is the case number (starting from 1) and M is the number of trailing sifar for N!

입력 예시 Copy

5
10
118
211
0

출력 예시 Copy

Case #1: 1
Case #2: 2
Case #3: 27
Case #4: 51