a, b = map(int, input().split())
while a > 0:
    a, b = b % a, a
ret = 1
d = 2
while b >= d * d:
    if b % d == 0:
        ret += 1
        while b % d == 0:
            b //= d
    d += 1
if b > 1:
    ret += 1
print(ret)
 a, b = map(int, input().split()) a map(int, input().split()) map int input().split() ().split () input split b while a > 0:
    a, b = b % a, a a > 0 a 0 a, b = b % a, a a b % a b a b a ret = 1 ret 1 d = 2 d 2 while b >= d * d:
    if b % d == 0:
        ret += 1
        while b % d == 0:
            b //= d
    d += 1 b >= d * d b d * d d d if b % d == 0:
        ret += 1
        while b % d == 0:
            b //= d
     b % d == 0 b % d b d 0 ret += 1 ret 1 while b % d == 0:
            b //= d
     b % d == 0 b % d b d 0 b //= d b d d += 1 d 1 if b > 1:
    ret += 1 b > 1 b 1 ret += 1 ret 1 print(ret) print ret ret += 1 1 ret a, b = b % a, a b % a a ret = 1 1 ret d = 2 2 d a, b = map(int, input().split()) map(int, input().split()) a ret += 1 1 ret b = map(int, input().split()) map(int, input().split()) b b //= d d b b = b % a, a a b d += 1 1 d
a, b = map(int, input().split())
while a > 0:
    a, b = b % a, a
ret = 1
d = 2
while b >= d * d:
    if b % d == 0:
        ret += 1
        while b % d == 0:
            b //= d
    d += 1
if b > 1:
    ret += 1
print(ret)

