from fractions import gcd

def make_divisors(n):

    divisors = []

    for i in range(1, int(n**0.5)+1):

        if n % i == 0:

            divisors.append(i)

            if i != n // i:

                divisors.append(n//i)



    # divisors.sort()

    return divisors

    

    

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

a_d = make_divisors(a)

b_d = make_divisors(b)



yakusu = []



for i in a_d:

    if i in b_d:

        yakusu.append(i)



ans = [yakusu.pop(0)]

for i in yakusu:

    flg=0

    tmp = 0

    for j,num in enumerate(ans):

        if gcd(num,i) != 1:

            ans[j] = min(i,num)

            flg = 1

            break

    if flg == 0:

        ans.append(i)



print((len(ans)))



def gcd(x,y):

    return x if y==0 else gcd(y, x%y)



def factorize(n):

    pnum = []

    for i in range(2,int(n**0.5)+1):

        if n%i != 0:

            continue

        pnum.append([i,0])

        while n%i == 0:

            n /= i

            pnum[-1][1] += 1

    if n != 1:

        pnum.append([int(n),1])

    return pnum

    

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

n = gcd(a,b)

pnum = factorize(n)

print((len(pnum)+1))
from fractions import gcd


def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5) + 1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n // i)
    # divisors.sort()
    return divisors


a, b = list(map(int, input().split()))
a_d = make_divisors(a)
b_d = make_divisors(b)
yakusu = []
for i in a_d:
    if i in b_d:
        yakusu.append(i)
ans = [yakusu.pop(0)]
for i in yakusu:
    flg = 0
    tmp = 0
    for j, num in enumerate(ans):
        if gcd(num, i) != 1:
            ans[j] = min(i, num)
            flg = 1
            break
    if flg == 0:
        ans.append(i)
print((len(ans)))

def gcd(x, y):
    return x if y == 0 else gcd(y, x % y)


def factorize(n):
    pnum = []
    for i in range(2, int(n**0.5) + 1):
        if n % i != 0:
            continue
        pnum.append([i, 0])
        while n % i == 0:
            n /= i
            pnum[-1][1] += 1
    if n != 1:
        pnum.append([int(n), 1])
    return pnum


a, b = list(map(int, input().split()))
n = gcd(a, b)
pnum = factorize(n)
print((len(pnum) + 1))

-from fractions import gcd +def gcd(x, y): +    return x if y == 0 else gcd(y, x % y) -def make_divisors(n): -    divisors = [] -    for i in range(1, int(n**0.5) + 1): -        if n % i == 0: -            divisors.append(i) -            if i != n // i: -                divisors.append(n // i) -    # divisors.sort() -    return divisors +def factorize(n): +    pnum = [] +    for i in range(2, int(n**0.5) + 1): +        if n % i != 0: +            continue +        pnum.append([i, 0]) +        while n % i == 0: +            n /= i +            pnum[-1][1] += 1 +    if n != 1: +        pnum.append([int(n), 1]) +    return pnum -a_d = make_divisors(a) -b_d = make_divisors(b) -yakusu = [] -for i in a_d: -    if i in b_d: -        yakusu.append(i) -ans = [yakusu.pop(0)] -for i in yakusu: -    flg = 0 -    tmp = 0 -    for j, num in enumerate(ans): -        if gcd(num, i) != 1: -            ans[j] = min(i, num) -            flg = 1 -            break -    if flg == 0: -        ans.append(i) -print((len(ans))) +n = gcd(a, b) +pnum = factorize(n) +print((len(pnum) + 1))