LCC '18 Contest 5 J3 - Mr Tu's Zeros

View as PDF

Submit solution

Points: 5 (partial)
Time limit: 0.5s
Memory limit: 64M

Author:
Problem type

In Mr. Tu's ICS2O class, you were tasked to write a program that rates the overall worth of a set of N numbers (worth is equal to the number of trailing zeros when all of the numbers in the set are multiplied together).

Trailing zeros are defined as the zeros at the end of a number (Ex. 102000 has 3 trailing zeros).

Given a set of N numbers, Mr. Tu would like you to determine the overall worth of the set.

Input Specification

The first line will contain the integer, N (1\le N\le 100), representing how many integers will be in the set.

The next N lines will contain one integer, I (0\le I\le 100), representing an integer in the set.

Output Specification

Output the overall worth of the integers.

Subtasks

Subtask 1 [15%]

1\le N\le 10

0\le I\le 10

Subtask 2 [85%]

No further constraints are given.

Sample Input 1

3
2
19
10

Sample Output 1

1

Explanation for Sample 1

2\times19\times10 = 380, therefore there is only one trailing zero.

Sample Input 2

5
10
8
15
10
10

Sample Output 2

4

Explanation for Sample 2

10\times8\times15\times10\times10 = 120000, therefore there are 4 trailing zeros.


Comments

There are no comments at the moment.