Submit solution
Points:
10
Time limit:
1.0s
Memory limit:
16M
Problem type
Allowed languages
ALGOL 68, Assembly, Brain****, C, C++, COBOL, Forth, Fortran, Java, Lua, Text, Turing
ACSL Practice 2009
The factorial of a positive integer , written as , is the product of the first positive integers. That is,
Given a positive integer , find the number of zeros in the decimal representation of . Of course, leading zeros should not be counted. (Note that decimal representation means base ten representation.)
Example 1. There are zeros in the decimal representation of .
Example 2. There are zeros in the decimal representation of .
Example 3. There is no zero in the decimal representation of .
Input Specification
The input contains a single positive integer .
Output Specification
The number of zeros in the decimal representation of .
Sample Input 1
20
Sample Output 1
7
Sample Input 2
7
Sample Output 2
2
Sample Input 3
4
Sample Output 3
0
Comments
Since Java's BigInteger class is unintended and defeats the point of this problem, it has been disabled, and all Java submissions were rejudged.