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