Hex Factorial

Time Limit: 2000ms
Memory Limit: 32768KB
This problem will be judged on HDU. Original ID: 2940
64-bit integer IO format: %I64d      Java class name: Main

Description

The expression N!, reads as the factorial of N, denoting the product of the first N positive integers. If the factorial of N is written in hexadecimal without leading zeros, can you tell us how many zeros are there in it? Take 15! as an example, you should answer "3" because (15)10! = (13077775800)16, and there are 3 zeros in it.

Input

The input contains several cases. Each case has one line containing a non-negative decimal integer N (N ≤ 100). You need to count the zeros in N! in hexadecimal. A negative number terminates the input.

Output

For each non-negative integer N, output one line containing exactly one integer, indicating the number of
zeros in N!.

Sample Input

1
15
-1

Sample Output

0
3

Source

Language: 
Theme: 
Share Code? 

Powered by NB231 | Current Style: .