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

def gcd(a,b):

	if b == 0:

		return a

	else:

		return gcd(b,a%b)

def make_divisors(n):

    divisors = []

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

        if n % i == 0:

            divisors.append(i)

            if i != n // i:

                divisors.append(n//i)

    return divisors

gcd = gcd(max(A,B),min(A,B))

divisors = sorted(make_divisors(gcd))

divisors.pop(0)

ans = [1]

while divisors:

    i = divisors.pop(0)

    for j in range(len(divisors)-1,-1,-1):

        if divisors[j]%i == 0:

            divisors.pop(j)

    ans.append(i)

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

def gcd(a,b):

	if b == 0:

		return a

	else:

		return gcd(b,a%b)

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



gcd = gcd(A,B)

p = set(prime_factorize(gcd))

print((len(p)+1))

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


def gcd(a, b):
    if b == 0:
        return a
    else:
        return gcd(b, a % b)


def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5) + 1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n // i)
    return divisors


gcd = gcd(max(A, B), min(A, B))
divisors = sorted(make_divisors(gcd))
divisors.pop(0)
ans = [1]
while divisors:
    i = divisors.pop(0)
    for j in range(len(divisors) - 1, -1, -1):
        if divisors[j] % i == 0:
            divisors.pop(j)
    ans.append(i)
print((len(ans)))

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


def gcd(a, b):
    if b == 0:
        return a
    else:
        return gcd(b, a % b)


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


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

-def make_divisors(n): -    divisors = [] -    for i in range(1, int(n**0.5) + 1): -        if n % i == 0: -            divisors.append(i) -            if i != n // i: -                divisors.append(n // i) -    return divisors +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 -gcd = gcd(max(A, B), min(A, B)) -divisors = sorted(make_divisors(gcd)) -divisors.pop(0) -ans = [1] -while divisors: -    i = divisors.pop(0) -    for j in range(len(divisors) - 1, -1, -1): -        if divisors[j] % i == 0: -            divisors.pop(j) -    ans.append(i) -print((len(ans))) +gcd = gcd(A, B) +p = set(prime_factorize(gcd)) +print((len(p) + 1))