#C6646. Trailing Zeros in Factorial
Trailing Zeros in Factorial
Trailing Zeros in Factorial
Given a non-negative integer n, calculate the number of trailing zeros at the end of n! (n factorial). This problem can be solved by counting the number of times the factor 5 appears in the factors of all numbers from 1 to n. In mathematical notation, the result is given by:
\( \text{zeros}(n) = \sum_{k=1}^{\infty} \left\lfloor \frac{n}{5^k} \right\rfloor \)
The input will be a single integer, and the output should be the number of trailing zeros in n!.
inputFormat
The input consists of a single line containing one integer n (0 ≤ n ≤ 109).
outputFormat
Output a single integer which is the number of trailing zeros in n!.
## sample5
1