from math import gcd
a, b = map(int, input().split())

gcd = gcd(a, b)
ans = 1
n = int(gcd**0.5) + 2
for i in range(2, n):
    if gcd%i == 0:
        ans += 1
        while gcd%i == 0:
            gcd //= i
    if gcd < i:
        break
if gcd >= n:
    ans += 1
if ans == 1 and gcd != 1:
    ans = 2
    
print(ans) from math import gcd a, b = map(int, input().split()) a map(int, input().split()) map int input().split() ().split () input split b gcd = gcd(a, b) gcd gcd(a, b) gcd a b ans = 1 ans 1 n = int(gcd**0.5) + 2 n int(gcd**0.5) + 2 int(gcd**0.5) int gcd**0.5 gcd 0.5 2 for i in range(2, n):
    if gcd%i == 0:
        ans += 1
        while gcd%i == 0:
            gcd //= i
    if gcd < i:
        break i range(2, n) range 2 n if gcd%i == 0:
        ans += 1
        while gcd%i == 0:
            gcd //= i
     gcd%i == 0 gcd%i gcd i 0 ans += 1 ans 1 while gcd%i == 0:
            gcd //= i
     gcd%i == 0 gcd%i gcd i 0 gcd //= i gcd i if gcd < i:
        break gcd < i gcd i break if gcd >= n:
    ans += 1 gcd >= n gcd n ans += 1 ans 1 if ans == 1 and gcd != 1:
    ans = 2
     ans == 1 and gcd != 1 ans == 1 ans 1 gcd != 1 gcd 1 ans = 2 ans 2 print(ans) print ans n = int(gcd**0.5) + 2 int(gcd**0.5) + 2 n ans = 1 1 ans ans += 1 1 ans ans += 1 1 ans b = map(int, input().split()) map(int, input().split()) b gcd //= i i gcd a, b = map(int, input().split()) map(int, input().split()) a gcd = gcd(a, b) gcd(a, b) gcd ans = 2 2 ans
from math import gcd
a, b = map(int, input().split())

gcd = gcd(a, b)
ans = 1
n = int(gcd**0.5) + 2
for i in range(2, n):
    if gcd%i == 0:
        ans += 1
        while gcd%i == 0:
            gcd //= i
    if gcd < i:
        break
if gcd >= n:
    ans += 1
if ans == 1 and gcd != 1:
    ans = 2
    
print(ans)