#abc142d. [abc142_d]Disjoint Set of Common Divisors

[abc142_d]Disjoint Set of Common Divisors

Problem Statement

Given are positive integers AA and BB.

Let us choose some number of positive common divisors of AA and BB.

Here, any two of the chosen divisors must be coprime.

At most, how many divisors can we choose?

Definition of common divisor

An integer dd is said to be a common divisor of integers xx and yy when dd divides both xx and yy.

Definition of being coprime

Integers xx and yy are said to be coprime when xx and yy have no positive common divisors other than 11.

Definition of dividing

An integer xx is said to divide another integer yy when there exists an integer alpha\\alpha such that y=alphaxy = \\alpha x.

Constraints

  • All values in input are integers.
  • 1leqA,Bleq10121 \\leq A, B \\leq 10^{12}

Input

Input is given from Standard Input in the following format:

AA BB

Output

Print the maximum number of divisors that can be chosen to satisfy the condition.


Sample Input 1

12 18

Sample Output 1

3

1212 and 1818 have the following positive common divisors: 11, 22, 33, and 66.

11 and 22 are coprime, 22 and 33 are coprime, and 33 and 11 are coprime, so we can choose 11, 22, and 33, which achieve the maximum result.


Sample Input 2

420 660

Sample Output 2

4

Sample Input 3

1 2019

Sample Output 3

1

11 and 20192019 have no positive common divisors other than 11.