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


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

g = gcd(a, b)
num = g

ans = 1

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

    if num % i == 0:
        ans += 1
        while num % i == 0:
            num = num // i

if num != 1:
    ans += 1

print(ans) def gcd(a, b):
    if b == 0:
        return a
    return gcd(b, a % b) gcd if b == 0:
        return a
     b == 0 b 0 return a a return gcd(b, a % b) gcd(b, a % b) gcd b a % b a b a a b b a, b = map(int, input().split()) a map(int, input().split()) map int input().split() ().split () input split b g = gcd(a, b) g gcd(a, b) gcd a b num = g num g ans = 1 ans 1 for i in range(2, int(g ** 0.5) + 1):

    if num % i == 0:
        ans += 1
        while num % i == 0:
            num = num // i i range(2, int(g ** 0.5) + 1) range 2 int(g ** 0.5) + 1 int(g ** 0.5) int g ** 0.5 g 0.5 1 if num % i == 0:
        ans += 1
        while num % i == 0:
            num = num // i num % i == 0 num % i num i 0 ans += 1 ans 1 while num % i == 0:
            num = num // i num % i == 0 num % i num i 0 num = num // i num num // i num i if num != 1:
    ans += 1 num != 1 num 1 ans += 1 ans 1 print(ans) print ans def gcd(a, b):
    if b == 0:
        return a
    return gcd(b, a % b) def gcd(a, b):
    if b == 0:
        return a
    return gcd(b, a % b) gcd ans += 1 1 ans a, b = map(int, input().split()) map(int, input().split()) a num = num // i num // i num b = map(int, input().split()) map(int, input().split()) b ans = 1 1 ans ans += 1 1 ans g = gcd(a, b) gcd(a, b) g num = g g num
def gcd(a, b):
    if b == 0:
        return a
    return gcd(b, a % b)


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

g = gcd(a, b)
num = g

ans = 1

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

    if num % i == 0:
        ans += 1
        while num % i == 0:
            num = num // i

if num != 1:
    ans += 1

print(ans)
