6684.Trailing Zeros

Time Limit: 1s Memory Limit: 512MB

Your task is to calculate the number of trailing zeros in the factorial $n!$ .

For example, $20!=2432902008176640000$ and it has $4$ trailing zeros.

Input Format(From the terminal/stdin)

The only input line has an integer $n$ .

  • $1 \le n \le 10^9$

Output Format(To the terminal/stdout)

Print the number of trailing zeros in $n!$ .

Sample Input

Copy
20
  \n

Sample Output

Copy
4
 \n
Source: CSES, Introductory Problems, 1618

Submit

请先 登录

© 2025 FAQs