def factorization(n):

    arr = {}

    temp = n

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

        if temp%i==0:

            cnt=0

            while temp%i==0:

                cnt+=1

                temp //= i

            arr[i] = cnt



    if temp!=1:

        arr[temp] = 1



    if arr=={}:

        arr[n] = 1



    return arr





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

a_fac = factorization(a)

b_fac = factorization(b)

lcm = {}

for prime,cnt in list(a_fac.items()):

    if prime in b_fac and prime != 1:

        lcm[prime] = min(cnt, b_fac[prime])



print((len(lcm)+1))
from math import gcd



def factorization(n):

    pf_cnt = {}

    temp = n

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

        if temp%i == 0:

            cnt = 0

            while temp%i == 0:

                cnt += 1

                temp //= i

            if i != 1: pf_cnt[i] = cnt



    if temp != 1: pf_cnt[temp] = 1

    if not pf_cnt and n != 1: pf_cnt[n] = 1



    return pf_cnt



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

ab_gcd = gcd(a,b)

fac = factorization(ab_gcd)

print((len(fac)+1))
def factorization(n):
    arr = {}
    temp = n
    for i in range(2, int(-(-(n**0.5) // 1)) + 1):
        if temp % i == 0:
            cnt = 0
            while temp % i == 0:
                cnt += 1
                temp //= i
            arr[i] = cnt
    if temp != 1:
        arr[temp] = 1
    if arr == {}:
        arr[n] = 1
    return arr


a, b = list(map(int, input().split()))
a_fac = factorization(a)
b_fac = factorization(b)
lcm = {}
for prime, cnt in list(a_fac.items()):
    if prime in b_fac and prime != 1:
        lcm[prime] = min(cnt, b_fac[prime])
print((len(lcm) + 1))

from math import gcd


def factorization(n):
    pf_cnt = {}
    temp = n
    for i in range(2, int(-(-(n**0.5) // 1)) + 1):
        if temp % i == 0:
            cnt = 0
            while temp % i == 0:
                cnt += 1
                temp //= i
            if i != 1:
                pf_cnt[i] = cnt
    if temp != 1:
        pf_cnt[temp] = 1
    if not pf_cnt and n != 1:
        pf_cnt[n] = 1
    return pf_cnt


a, b = list(map(int, input().split()))
ab_gcd = gcd(a, b)
fac = factorization(ab_gcd)
print((len(fac) + 1))

+from math import gcd + + -    arr = {} +    pf_cnt = {} -            arr[i] = cnt +            if i != 1: +                pf_cnt[i] = cnt -        arr[temp] = 1 -    if arr == {}: -        arr[n] = 1 -    return arr +        pf_cnt[temp] = 1 +    if not pf_cnt and n != 1: +        pf_cnt[n] = 1 +    return pf_cnt -a_fac = factorization(a) -b_fac = factorization(b) -lcm = {} -for prime, cnt in list(a_fac.items()): -    if prime in b_fac and prime != 1: -        lcm[prime] = min(cnt, b_fac[prime]) -print((len(lcm) + 1)) +ab_gcd = gcd(a, b) +fac = factorization(ab_gcd) +print((len(fac) + 1))