Under construction

Still being built. Things may change

Number of Trailing Zeros in a Factorial

Interview

Time limit2sMemory limit128 MB

Summary
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!.

Examples2

  1. Example 1

    Input
    10
    
    Expected output
    2
    
  2. Example 2

    Input
    3
    
    Expected output
    0