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



common_divisors = []

for n in range(1, int(min(A, B) ** 0.5) + 1):

    if (A % n == 0) & (B % n == 0):

        common_divisors.append(n)



    if A % n == 0:

        x = A // n

        if B % x == 0:

            common_divisors.append(x)





# ある自然数の素数判定

def is_prime(n):

    if n == 1:

        return False



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

        if n % i == 0:

            return False

    else:

        return True





ans = 0

for cd in common_divisors:

    ans += is_prime(cd)



print((ans + 1))

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





def prime_factorization(n):

    table = []

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

        while n % x == 0:

            table.append(x)

            n //= x

    if n > 1:

        table.append(n)

    return table





A_factor = set(prime_factorization(A))

B_factor = set(prime_factorization(B))

print((len(A_factor & B_factor) + 1))

A, B = list(map(int, input().split()))
common_divisors = []
for n in range(1, int(min(A, B) ** 0.5) + 1):
    if (A % n == 0) & (B % n == 0):
        common_divisors.append(n)
    if A % n == 0:
        x = A // n
        if B % x == 0:
            common_divisors.append(x)
# ある自然数の素数判定
def is_prime(n):
    if n == 1:
        return False
    for i in range(2, int(n**0.5) + 1):
        if n % i == 0:
            return False
    else:
        return True


ans = 0
for cd in common_divisors:
    ans += is_prime(cd)
print((ans + 1))

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


def prime_factorization(n):
    table = []
    for x in range(2, int(n**0.5) + 1):
        while n % x == 0:
            table.append(x)
            n //= x
    if n > 1:
        table.append(n)
    return table


A_factor = set(prime_factorization(A))
B_factor = set(prime_factorization(B))
print((len(A_factor & B_factor) + 1))

-common_divisors = [] -for n in range(1, int(min(A, B) ** 0.5) + 1): -    if (A % n == 0) & (B % n == 0): -        common_divisors.append(n) -    if A % n == 0: -        x = A // n -        if B % x == 0: -            common_divisors.append(x) -# ある自然数の素数判定 -def is_prime(n): -    if n == 1: -        return False -    for i in range(2, int(n**0.5) + 1): -        if n % i == 0: -            return False -    else: -        return True -ans = 0 -for cd in common_divisors: -    ans += is_prime(cd) -print((ans + 1)) +def prime_factorization(n): +    table = [] +    for x in range(2, int(n**0.5) + 1): +        while n % x == 0: +            table.append(x) +            n //= x +    if n > 1: +        table.append(n) +    return table + + +A_factor = set(prime_factorization(A)) +B_factor = set(prime_factorization(B)) +print((len(A_factor & B_factor) + 1))