Problems
518 - Number of zeroes in n!
SUBMIT PROBLEM

Number of zeroes in n!

Time Limit: 1 sec

 

The Problem

Factorial n is written as n! and n! = 1∗2∗3∗. . .∗(n−1)∗n.

For example,

2! = 1 x 2 = 2

3! = 1 x 2 x 3 = 6

4! = 1 x 2 x 3 x 4 = 24

5! = 1 x 2 x 3 x 4 x 5 = 120

6! = 720

7! = 5040

8! = 40320

9! = 362880

10! = 3628800

etc.

 

The function fzero(n) denotes the number of trailing zeroes in n! in decimal number system.

For example,

fzero(2) = 0

fzero(5) = 1

fzero(7) = 1

fzero(10) = 2

etc.

 

Given an integer number n, you will have to find out how many trailing zeroses in n!.

 

The Input

Input file contain a series of line, each line contain one integer numbers n (0<n<1016. Input is terminated by EOF.

 

The Output

For each line of input, output will show the number of trailing zeroes in n! in a separate line.

 

Sample Input

3

7

14

 

Sample Output

0

1

2

 

 

 

 

Problem Setter: Shahin ShamS