Number of Trailing Zeros in a Factorial
InterviewTime limit2sMemory limit128 MB
Count the trailing zeros of N! for N up to 500 by counting factors of 5.
- Level
Easy3 of 10
- Topics
- Math, Number theory, Implementation
- Solved
- No attempts yet
Problem
Given an integer N, find how many consecutive zeros appear at the end of the decimal representation of N!.
Input
The first line contains an integer N.
- 0 <= N <= 500
Output
Print the number of trailing zeros in N!.