from fractions import gcd

def f(n):

    tmp = n

    cnt = 0

    i = 2

    while i <= n**0.5 + 1:

        if tmp < i:

            break

        if tmp % i == 0:

            cnt += 1

            while tmp % i == 0:

                tmp //= i

        i += 1

    if tmp != 1:

        cnt += 1

    return cnt



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

g = gcd(A, B)

ans = f(g) + 1

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

# https://www.iandprogram.net/entry/2015/03/18/003511

def gcd(x, y):

    if y == 0:

        return x

    else:

        return gcd(y, x%y)

# https://qiita.com/kageyasai2/items/48ef81f39b4e31c6d396

def factorize(n):

    factor = []

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

        while n % num == 0:

            n //= num

            factor.append(num)

    if n != 1:

        factor.append(n)

    return set(factor)

    

g = gcd(A, B)

f = factorize(g)

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


def f(n):
    tmp = n
    cnt = 0
    i = 2
    while i <= n**0.5 + 1:
        if tmp < i:
            break
        if tmp % i == 0:
            cnt += 1
            while tmp % i == 0:
                tmp //= i
        i += 1
    if tmp != 1:
        cnt += 1
    return cnt


A, B = list(map(int, input().split()))
g = gcd(A, B)
ans = f(g) + 1
print(ans)

A, B = list(map(int, input().split()))
# https://www.iandprogram.net/entry/2015/03/18/003511
def gcd(x, y):
    if y == 0:
        return x
    else:
        return gcd(y, x % y)


# https://qiita.com/kageyasai2/items/48ef81f39b4e31c6d396
def factorize(n):
    factor = []
    for num in range(2, int(n**0.5 + 1)):
        while n % num == 0:
            n //= num
            factor.append(num)
    if n != 1:
        factor.append(n)
    return set(factor)


g = gcd(A, B)
f = factorize(g)
print((len(f) + 1))

-from fractions import gcd +A, B = list(map(int, input().split())) +# https://www.iandprogram.net/entry/2015/03/18/003511 +def gcd(x, y): +    if y == 0: +        return x +    else: +        return gcd(y, x % y) -def f(n): -    tmp = n -    cnt = 0 -    i = 2 -    while i <= n**0.5 + 1: -        if tmp < i: -            break -        if tmp % i == 0: -            cnt += 1 -            while tmp % i == 0: -                tmp //= i -        i += 1 -    if tmp != 1: -        cnt += 1 -    return cnt +# https://qiita.com/kageyasai2/items/48ef81f39b4e31c6d396 +def factorize(n): +    factor = [] +    for num in range(2, int(n**0.5 + 1)): +        while n % num == 0: +            n //= num +            factor.append(num) +    if n != 1: +        factor.append(n) +    return set(factor) -A, B = list(map(int, input().split())) -ans = f(g) + 1 -print(ans) +f = factorize(g) +print((len(f) + 1))