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



def fctr1(n): 

    f = []

    c = 0

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

        while n%i == 0:

            c += 1

            n = n//i

        if c !=0:

            f.append([i,c])

            c = 0

    if n != 1:

        f.append([n,1])

    return f



dlist = fctr1(a)

#print(dlist)

ans = 1

for i in range(len(dlist)):

    if b%dlist[i][0] == 0:

        ans += 1

print(ans)



#nの素因数分解(O(n**0.5)

def prime_factor(n):

    ass = []

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

        while n%i == 0:

            ass.append(i)

            n = n//i

    if n != 1:

        ass.append(n)

    return ass



#a,bの最大公約数

def gcd(a,b):

    while b:

        a,b = b,a%b

    return a



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



print((len(set(prime_factor(gcd(a,b))))+1))

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


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


dlist = fctr1(a)
# print(dlist)
ans = 1
for i in range(len(dlist)):
    if b % dlist[i][0] == 0:
        ans += 1
print(ans)

# nの素因数分解(O(n**0.5)
def prime_factor(n):
    ass = []
    for i in range(2, int(n**0.5) + 1):
        while n % i == 0:
            ass.append(i)
            n = n // i
    if n != 1:
        ass.append(n)
    return ass


# a,bの最大公約数
def gcd(a, b):
    while b:
        a, b = b, a % b
    return a


a, b = list(map(int, input().split()))
print((len(set(prime_factor(gcd(a, b)))) + 1))

-a, b = list(map(int, input().split())) +# nの素因数分解(O(n**0.5) +def prime_factor(n): +    ass = [] +    for i in range(2, int(n**0.5) + 1): +        while n % i == 0: +            ass.append(i) +            n = n // i +    if n != 1: +        ass.append(n) +    return ass -def fctr1(n): -    f = [] -    c = 0 -    for i in range(2, int(n**0.5) + 2): -        while n % i == 0: -            c += 1 -            n = n // i -        if c != 0: -            f.append([i, c]) -            c = 0 -    if n != 1: -        f.append([n, 1]) -    return f +# a,bの最大公約数 +def gcd(a, b): +    while b: +        a, b = b, a % b +    return a -dlist = fctr1(a) -# print(dlist) -ans = 1 -for i in range(len(dlist)): -    if b % dlist[i][0] == 0: -        ans += 1 -print(ans) +a, b = list(map(int, input().split())) +print((len(set(prime_factor(gcd(a, b)))) + 1))