### ACSL Practice 2009

## Task 3: Zeros

The *factorial* of a positive integer *n*,
written as *n*!, is the product of the
first *n* positive integers. That is,

*n*! = 1 × 2 × ... ×

*n*

Given a positive integer *n*, find the number of zeros in the decimal representation of *n*!. Of course, leading zeros should not be counted. (Note that decimal representation means base ten representation.)

**Example 1.** There are 7 zeros in the decimal representation of 20!.

20! = 1 × 2 × ... × 19 × 20 = 2432902008176640000

**Example 2.**There are 2 zeros in the decimal representation of 7!.

7! = 1 × 2 × 3 × 4 × 5 × 6 × 7 = 5040

**Example 3.**There is no zero in the decimal representation of 4!.

4! = 1 × 2 × 3 × 4 = 24

### Input

The input contains a single positive integer *n* ≤ 100.

### Output

The number of zeros in the decimal representation of *n*!.

### Examples

## Input20 ## Output7 |
## Input7 ## Output2 |
## Input4 ## Output0 |

All Submissions

Best Solutions

**Point Value:** 10

**Time Limit:** 2.00s

**Memory Limit:** 16M

**Added:** May 16, 2009

**Languages Allowed:**

C++03, PAS, C, ASM, PHP, C#, C++11

## Comments (Search)

Jim42069on Jan 11, 2018 - 2:33:04 pm UTC Help?jargonon Jan 11, 2018 - 6:52:44 pm UTC Re: Help?Jim42069on Jan 11, 2018 - 9:02:17 pm UTC Re: Help?jargonon Jan 12, 2018 - 4:08:44 pm UTC Re: Help?You may wish to take a closer look at your loops.

ImbaCalvinon Jul 11, 2013 - 1:51:28 am UTC Error...bbi5291on Jul 18, 2013 - 5:43:57 am UTC Re: Error...321227506on Nov 16, 2011 - 7:01:33 am UTC No Java???jargonon Nov 16, 2011 - 1:36:08 pm UTC Re: No Java???Danielon May 17, 2009 - 1:29:20 pm UTC cheapness!jargonon May 17, 2009 - 2:16:33 pm UTC Re: cheapness!alvinqiuon May 17, 2009 - 3:57:39 pm UTC Re: cheapness!