题目描述
Given a non-negative integer N, the factorial of N is N!, now you should calculate the number of 0 at the end of N!.
For example, N=10, N! =3628800, then the number of 0 at the end of N! is 2.
输入
Input includes multiple rows of data, one non-negative integer N per line, 0<=N<=100000
输出
For each N input, output the number of 0 at the end of N!., wrap between multiple outputs.
样例输入 Copy
0
1
2
3
4
5
6
7
8
9
10
样例输出 Copy
0
0
0
0
0
1
1
1
1
1
2
def count(n):
ret=0
while(n):
ret+=n//5
n//=5
return ret
while True:
n=int(input())
print(count(n))