N!
time limit per test 2 second memory limit per test 256 megabytes
Give you an integer n, find the maximum k that satisfies
n!mod10k=0

传送门:EOJ3233

Input

There are several test cases, please process till EOF. For each test case, there is only one line contains integer n (1≤n≤10^9).

Output

For each test case, output the answer in one line.

Sample Input

1
2
2
5

Sample Output

1
2
0
1

题解

阶乘尾零变形题 就一种套路 int n while(n>0) {count+=n/5;n=n/5;} 每次除的5相当于阶乘中每一个有的5
## AC code:(不包含输入类)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import java.io.*;  
import java.util.*;
public class Main {
public static void main(String[] args) {
FastScanner sc = new FastScanner();
PrintWriter pw = new PrintWriter(System.out);
while (sc.hasNext()) {
int n=sc.nextInt();
pw.println(zero(n));
pw.flush();
}
}
static int zero(int k){
int count=0;
while(k>0){
count+=k/5;
k/=5;
}
return count;
}
static int js(int n) {
int count = 0;
int temp=n/5;
while (temp!=0) {
count+=temp;
temp/=5;
}
return count;
}
}