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





def gcd(a, b):

    while b:

        a, b = b, a % b

    return a





def prime_decomposition(n):

    i = 2

    table = []

    while i * i <= n:

        while n % i == 0:

            n /= i

            table.append(i)

        i += 1

    if n > 1:

        table.append(n)

    return table





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





def gcd(a, b):

    while b:

        a, b = b, a % b

    return a





def prime_factorize(n):

    a = []

    while n % 2 == 0:

        a.append(2)

        n //= 2

    f = 3

    while f * f <= n:

        if n % f == 0:

            a.append(f)

            n //= f

        else:

            f += 2

    if n != 1:

        a.append(n)

    return a





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


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


def prime_decomposition(n):
    i = 2
    table = []
    while i * i <= n:
        while n % i == 0:
            n /= i
            table.append(i)
        i += 1
    if n > 1:
        table.append(n)
    return table


print((len(set(prime_decomposition(gcd(A, B)))) + 1))

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


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


def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a


print((len(set(prime_factorize(gcd(A, B)))) + 1))

-def prime_decomposition(n): -    i = 2 -    table = [] -    while i * i <= n: -        while n % i == 0: -            n /= i -            table.append(i) -        i += 1 -    if n > 1: -        table.append(n) -    return table +def prime_factorize(n): +    a = [] +    while n % 2 == 0: +        a.append(2) +        n //= 2 +    f = 3 +    while f * f <= n: +        if n % f == 0: +            a.append(f) +            n //= f +        else: +            f += 2 +    if n != 1: +        a.append(n) +    return a -print((len(set(prime_decomposition(gcd(A, B)))) + 1)) +print((len(set(prime_factorize(gcd(A, B)))) + 1))