You are on page 1of 1

,

Avdeshs find-muck game


Input file: standard input
Output file: standard output
Time limit: 2 seconds
Memory limit: 64 megabytes

Avdesh was sitting in the garden and saw a kid playing a game: There were N piles of stones, such that
ith pile contains Ai stones. Suppose he takes a number x , then the ith pile will destroy if (Ai mod x = 0).
Find the number of such x, such that all the piles will destroy. Formally, find the count of x (x >= 1)
such that Ai mod x = 0 for all 1 <= i <= N .
Since hes too pro to solve such easy problem, He asks you to solve this problem!

Input
First line contains an integer N , the size of the array.
Second line contains N space separated integers denoting the array A.
Constraints:
1 N 105 1 Ai 1012

Output
A single line containing the count of such x.

Example
standard input standard output
4 1
2 3 2 4

Note
Only 1 divides all the 4 numbers in the array.

Page 1 of 1

You might also like