from math import ceil
from fractions import gcd

a, b = map(int, input().split())
c = gcd(a, b)
count = 1
for num in range(2, ceil(c**0.5) + 1):
  if c % num == 0:
    count += 1
    while c % num == 0:
      c = c // num
if c > 1:
  count += 1
print(count) from math import ceil from fractions import gcd a, b = map(int, input().split()) a map(int, input().split()) map int input().split() ().split () input split b c = gcd(a, b) c gcd(a, b) gcd a b count = 1 count 1 for num in range(2, ceil(c**0.5) + 1):
  if c % num == 0:
    count += 1
    while c % num == 0:
      c = c // num num range(2, ceil(c**0.5) + 1) range 2 ceil(c**0.5) + 1 ceil(c**0.5) ceil c**0.5 c 0.5 1 if c % num == 0:
    count += 1
    while c % num == 0:
      c = c // num c % num == 0 c % num c num 0 count += 1 count 1 while c % num == 0:
      c = c // num c % num == 0 c % num c num 0 c = c // num c c // num c num if c > 1:
  count += 1 c > 1 c 1 count += 1 count 1 print(count) print count a, b = map(int, input().split()) map(int, input().split()) a count = 1 1 count count += 1 1 count count += 1 1 count b = map(int, input().split()) map(int, input().split()) b c = gcd(a, b) gcd(a, b) c c = c // num c // num c
from math import ceil
from fractions import gcd

a, b = map(int, input().split())
c = gcd(a, b)
count = 1
for num in range(2, ceil(c**0.5) + 1):
  if c % num == 0:
    count += 1
    while c % num == 0:
      c = c // num
if c > 1:
  count += 1
print(count)