import math
a,b=map(int,input().split())
x=math.gcd(a,b)
bun=[0]*(int(math.sqrt(x)+1))
bun[1]=1
for i in range(2,len(bun)):
  while x%i==0:
    if bun[i]==0:
      bun[i]+=1
    x=x//i
ans=sum(bun)
if x>1:
  ans+=1
print(ans)   import math math a,b=map(int,input().split()) a map(int,input().split()) map int input().split() ().split () input split b x=math.gcd(a,b) x math.gcd(a,b) math.gcd math gcd a b bun=[0]*(int(math.sqrt(x)+1)) bun [0]*(int(math.sqrt(x)+1)) [0] 0 int(math.sqrt(x)+1) int math.sqrt(x)+1 math.sqrt(x) math.sqrt math sqrt x 1 bun[1]=1 bun[1] bun 1 1 for i in range(2,len(bun)):
  while x%i==0:
    if bun[i]==0:
      bun[i]+=1
    x=x//i i range(2,len(bun)) range 2 len(bun) len bun while x%i==0:
    if bun[i]==0:
      bun[i]+=1
    x=x//i x%i==0 x%i x i 0 if bun[i]==0:
      bun[i]+=1
     bun[i]==0 bun[i] bun i 0 bun[i]+=1 bun[i] bun i 1 x=x//i x x//i x i ans=sum(bun) ans sum(bun) sum bun if x>1:
  ans+=1 x>1 x 1 ans+=1 ans 1 print(ans) print ans b=map(int,input().split()) map(int,input().split()) b ans=sum(bun) sum(bun) ans x=x//i x//i x ans+=1 1 ans bun=[0]*(int(math.sqrt(x)+1)) [0]*(int(math.sqrt(x)+1)) bun a,b=map(int,input().split()) map(int,input().split()) a x=math.gcd(a,b) math.gcd(a,b) x
import math
a,b=map(int,input().split())
x=math.gcd(a,b)
bun=[0]*(int(math.sqrt(x)+1))
bun[1]=1
for i in range(2,len(bun)):
  while x%i==0:
    if bun[i]==0:
      bun[i]+=1
    x=x//i
ans=sum(bun)
if x>1:
  ans+=1
print(ans)  