#abc191f. [abc191_f]GCD or MIN

[abc191_f]GCD or MIN

Problem Statement

There are NN integers A1,A2,A3,dots,ANA_1, A_2, A_3, \\dots, A_N written on a blackboard.
You will do the following operation N1N - 1 times:

  • Choose two numbers written on the blackboard and erase them. Let xx and yy be the erased numbers. Then, write gcd(x,y)\\gcd(x, y) or min(x,y)\\min(x, y) on the blackboard.

After N1N - 1 operations, just one integer will remain on the blackboard. How many possible values of this number are there?

Constraints

  • 2leNle20002 \\le N \\le 2000
  • 1leAile1091 \\le A_i \\le 10^9
  • All values in input are integers.

Input

Input is given from Standard Input in the following format:

NN A1A_1 A2A_2 A3A_3 dots\\dots ANA_N

Output

Print the number of possible values of the last remaining number on the blackboard.


Sample Input 1

3
6 9 12

Sample Output 1

2

The possible values of the last remaining number are 33 and 66.
We will have 33 in the end if, for example, we do as follows:

  • choose 9,129, 12 and erase them from the blackboard, then write gcd(9,12)=3\\gcd(9, 12) = 3;
  • choose 6,36, 3 and erase them from the blackboard, then write min(6,3)=3\\min(6, 3) = 3.

Also, we will have 66 in the end if, for example, we do as follows:

  • choose 6,126, 12 and erase them from the blackboard, then write gcd(6,12)=6\\gcd(6, 12) = 6;
  • choose 6,96, 9 and erase them from the blackboard, then write min(6,9)=6\\min(6, 9) = 6.

Sample Input 2

4
8 2 12 6

Sample Output 2

1

22 is the only number that can remain on the blackboard.


Sample Input 3

7
30 28 33 49 27 37 48

Sample Output 3

7

11, 22, 33, 44, 66, 77, and 2727 can remain on the blackboard.