PHƯỚC HƯNG OJ · THỬ THÁCH THUẬT TOÁN

#GL0000124. Đếm ước chung (Common Divisors)

HỌC THEO LỘ TRÌNH

Bài tập thuộc lộ trình

1 lộ trình

Đếm ước chung (Common Divisors)

Common Divisors

Source: Codeforces

Version: Phuoc Hung OJ Extended

Problem Statement

Given nn positive integers, a positive integer dd is called a common divisor if it divides every array element. Count the positive common divisors of the array.

Input

The first line contains nn; the second contains nn integers aia_i.

Output

Print the number of positive common divisors.

Subtasks

  • Subtask 1 (20 points): 1≤n≤301\le n\le 30; 1≤ai≤100 0001\le a_i\le 100\,000.
  • Subtask 2 (30 points): 1≤n≤10 0001\le n\le 10\,000; 1≤ai≤1 000 000 0001\le a_i\le 1\,000\,000\,000.
  • Subtask 3 (50 points): 1≤n≤400 0001\le n\le 400\,000; 1≤ai≤1 000 000 000 0001\le a_i\le 1\,000\,000\,000\,000.

Examples

Input

6
6 90 12 18 30 18

Output

4

Explanation

The six numbers have GCD 6, whose four positive divisors are 1, 2, 3 and 6.