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

            if not i in arr:

                arr.append(i)



    if temp!=1:

        if not temp in arr:

                arr.append(temp)



    return arr



A,B = list(map(int,input().split()))

common = len(set(factorization(A)) & set(factorization(B)))

print((common+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

            if not i in arr:

                arr.append(i)



    if temp!=1:

        if not temp in arr:

                arr.append(temp)



    return arr



from fractions import gcd

A,B = list(map(int,input().split()))

print((len(factorization(gcd(A,B)))+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
            if not i in arr:
                arr.append(i)
    if temp != 1:
        if not temp in arr:
            arr.append(temp)
    return arr


A, B = list(map(int, input().split()))
common = len(set(factorization(A)) & set(factorization(B)))
print((common + 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
            if not i in arr:
                arr.append(i)
    if temp != 1:
        if not temp in arr:
            arr.append(temp)
    return arr


from fractions import gcd

A, B = list(map(int, input().split()))
print((len(factorization(gcd(A, B))) + 1))

+from fractions import gcd + -common = len(set(factorization(A)) & set(factorization(B))) -print((common + 1)) +print((len(factorization(gcd(A, B))) + 1))