import math



def gcd(n, m):

    while m != 0:

        n, m = m, n % m

    return n



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

g = gcd(a, b)

g_2 = int(math.sqrt(g))

cnt = 1



for i in range(2, g_2+1):

    if g % i == 0:

        while g % i == 0:

            g //= i

        cnt += 1

if g > 1:

    cnt += 1



print(cnt)

def gcd(a, b):

    while b != 0:

        a, b = b, a % b

    return a





def prime_factorization(n):

    res = []

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

        if n % i == 0:

            ex = 0

            while n % i == 0:

                ex += 1

                n //= i

            res.append([i, ex])

    if n != 1:

        res.append([n, 1])

    return res





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

g = gcd(a, b)

res = prime_factorization(g)

print((len(res) + 1))

import math


def gcd(n, m):
    while m != 0:
        n, m = m, n % m
    return n


a, b = list(map(int, input().split()))
g = gcd(a, b)
g_2 = int(math.sqrt(g))
cnt = 1
for i in range(2, g_2 + 1):
    if g % i == 0:
        while g % i == 0:
            g //= i
        cnt += 1
if g > 1:
    cnt += 1
print(cnt)

def gcd(a, b):
    while b != 0:
        a, b = b, a % b
    return a


def prime_factorization(n):
    res = []
    for i in range(2, int(pow(n, 0.5)) + 1):
        if n % i == 0:
            ex = 0
            while n % i == 0:
                ex += 1
                n //= i
            res.append([i, ex])
    if n != 1:
        res.append([n, 1])
    return res


a, b = list(map(int, input().split()))
g = gcd(a, b)
res = prime_factorization(g)
print((len(res) + 1))

-import math +def gcd(a, b): +    while b != 0: +        a, b = b, a % b +    return a -def gcd(n, m): -    while m != 0: -        n, m = m, n % m -    return n +def prime_factorization(n): +    res = [] +    for i in range(2, int(pow(n, 0.5)) + 1): +        if n % i == 0: +            ex = 0 +            while n % i == 0: +                ex += 1 +                n //= i +            res.append([i, ex]) +    if n != 1: +        res.append([n, 1]) +    return res -g_2 = int(math.sqrt(g)) -cnt = 1 -for i in range(2, g_2 + 1): -    if g % i == 0: -        while g % i == 0: -            g //= i -        cnt += 1 -if g > 1: -    cnt += 1 -print(cnt) +res = prime_factorization(g) +print((len(res) + 1))