a,b=list(map(int,input().split()))

from fractions import *

g=gcd(a,b)

c=i=1

while g>1 and i*i<=g:

    i+=1

    if g%i==0:

        c+=1

    while g%i==0:

        g//=i

print((c+(g>1)))
a,b=list(map(int,input().split()))

c=1

for i in range(2,int(max(a**.5,b**.5))+2):

    if a%i==0==b%i:

        c+=1

    while a%i==0:

        a//=i

    while b%i==0:

        b//=i

if a==b!=1:

    c+=1

print(c)
a, b = list(map(int, input().split()))
from fractions import *

g = gcd(a, b)
c = i = 1
while g > 1 and i * i <= g:
    i += 1
    if g % i == 0:
        c += 1
    while g % i == 0:
        g //= i
print((c + (g > 1)))

a, b = list(map(int, input().split()))
c = 1
for i in range(2, int(max(a**0.5, b**0.5)) + 2):
    if a % i == 0 == b % i:
        c += 1
    while a % i == 0:
        a //= i
    while b % i == 0:
        b //= i
if a == b != 1:
    c += 1
print(c)

-from fractions import * - -g = gcd(a, b) -c = i = 1 -while g > 1 and i * i <= g: -    i += 1 -    if g % i == 0: +c = 1 +for i in range(2, int(max(a**0.5, b**0.5)) + 2): +    if a % i == 0 == b % i: -    while g % i == 0: -        g //= i -print((c + (g > 1))) +    while a % i == 0: +        a //= i +    while b % i == 0: +        b //= i +if a == b != 1: +    c += 1 +print(c)