a, b = list(map(int, input().split(' ')))
def gcd(l, s):
  return l if s == 0 else gcd(s, l % s)

temp = gcd(a, b)

ans = 0
for i in range(2,1000000):
  if temp % i == 0:
    ans += 1
    while temp % i == 0:
      temp = temp // i
  if temp == 1:
    break
if temp != 1:
  ans += 1

print(ans+1) a, b = list(map(int, input().split(' '))) a list(map(int, input().split(' '))) list map(int, input().split(' ')) map int input().split(' ') ().split () input split ' ' b def gcd(l, s):
  return l if s == 0 else gcd(s, l % s) gcd return l if s == 0 else gcd(s, l % s) l if s == 0 else gcd(s, l % s) s == 0 s 0 l gcd(s, l % s) gcd s l % s l s l l s s temp = gcd(a, b) temp gcd(a, b) gcd a b ans = 0 ans 0 for i in range(2,1000000):
  if temp % i == 0:
    ans += 1
    while temp % i == 0:
      temp = temp // i
  if temp == 1:
    break i range(2,1000000) range 2 1000000 if temp % i == 0:
    ans += 1
    while temp % i == 0:
      temp = temp // i
   temp % i == 0 temp % i temp i 0 ans += 1 ans 1 while temp % i == 0:
      temp = temp // i
   temp % i == 0 temp % i temp i 0 temp = temp // i temp temp // i temp i if temp == 1:
    break temp == 1 temp 1 break if temp != 1:
  ans += 1 temp != 1 temp 1 ans += 1 ans 1 print(ans+1) print ans+1 ans 1 temp = gcd(a, b) gcd(a, b) temp ans += 1 1 ans b = list(map(int, input().split(' '))) list(map(int, input().split(' '))) b ans += 1 1 ans temp = temp // i temp // i temp ans = 0 0 ans a, b = list(map(int, input().split(' '))) list(map(int, input().split(' '))) a def gcd(l, s):
  return l if s == 0 else gcd(s, l % s) def gcd(l, s):
  return l if s == 0 else gcd(s, l % s) gcd
a, b = list(map(int, input().split(' ')))
def gcd(l, s):
  return l if s == 0 else gcd(s, l % s)

temp = gcd(a, b)

ans = 0
for i in range(2,1000000):
  if temp % i == 0:
    ans += 1
    while temp % i == 0:
      temp = temp // i
  if temp == 1:
    break
if temp != 1:
  ans += 1

print(ans+1)