import fractions

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

longer = max(a,b)

lcm = fractions.gcd(a,b)

i = 1

ans = 1

while True:

  i += 1

  if i * i >= longer:

    if lcm != 1:

      ans += 1

    break

  elif lcm == 1:

    break



  if lcm % i == 0:

    # print(i)

    ans += 1

    while lcm % i == 0:

      lcm //= i

# print(lcm)

print(ans)
import fractions

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

gc = fractions.gcd(a, b)



def prime_factorize(n):

    a = []

    if n % 2 == 0:

        a.append(2)

        while n % 2 == 0:

            n //= 2

    f = 3

    while f * f <= n:

        if n % f == 0:

            a.append(f)

            while n % f == 0:

                n //= f

        else:

            f += 2

    if n != 1:

        a.append(n)

    return a



print((len(prime_factorize(gc)) + 1))
import fractions

a, b = list(map(int, input().split()))
longer = max(a, b)
lcm = fractions.gcd(a, b)
i = 1
ans = 1
while True:
    i += 1
    if i * i >= longer:
        if lcm != 1:
            ans += 1
        break
    elif lcm == 1:
        break
    if lcm % i == 0:
        # print(i)
        ans += 1
        while lcm % i == 0:
            lcm //= i
# print(lcm)
print(ans)

import fractions

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


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


print((len(prime_factorize(gc)) + 1))

-longer = max(a, b) -lcm = fractions.gcd(a, b) -i = 1 -ans = 1 -while True: -    i += 1 -    if i * i >= longer: -        if lcm != 1: -            ans += 1 -        break -    elif lcm == 1: -        break -    if lcm % i == 0: -        # print(i) -        ans += 1 -        while lcm % i == 0: -            lcm //= i -# print(lcm) -print(ans) +gc = fractions.gcd(a, b) + + +def prime_factorize(n): +    a = [] +    if n % 2 == 0: +        a.append(2) +        while n % 2 == 0: +            n //= 2 +    f = 3 +    while f * f <= n: +        if n % f == 0: +            a.append(f) +            while n % f == 0: +                n //= f +        else: +            f += 2 +    if n != 1: +        a.append(n) +    return a + + +print((len(prime_factorize(gc)) + 1))