a,b=map(int,input().split())
c=1
for i in range(2,int(max(a**.5,b**.5))+2):
    if a%i==0==b%i:
        c+=1
    while a%i==0:
        a//=i
    while b%i==0:
        b//=i
if a==b!=1:
    c+=1
print(c) a,b=map(int,input().split()) a map(int,input().split()) map int input().split() ().split () input split b c=1 c 1 for i in range(2,int(max(a**.5,b**.5))+2):
    if a%i==0==b%i:
        c+=1
    while a%i==0:
        a//=i
    while b%i==0:
        b//=i i range(2,int(max(a**.5,b**.5))+2) range 2 int(max(a**.5,b**.5))+2 int(max(a**.5,b**.5)) int max(a**.5,b**.5) max a**.5 a .5 b**.5 b .5 2 if a%i==0==b%i:
        c+=1
     a%i==0==b%i a%i==0 a%i a i 0 b%i b i c+=1 c 1 while a%i==0:
        a//=i
     a%i==0 a%i a i 0 a//=i a i while b%i==0:
        b//=i b%i==0 b%i b i 0 b//=i b i if a==b!=1:
    c+=1 a==b!=1 a==b a b 1 c+=1 c 1 print(c) print c c+=1 1 c c+=1 1 c a//=i i a a,b=map(int,input().split()) map(int,input().split()) a c=1 1 c b=map(int,input().split()) map(int,input().split()) b b//=i i b
a,b=map(int,input().split())
c=1
for i in range(2,int(max(a**.5,b**.5))+2):
    if a%i==0==b%i:
        c+=1
    while a%i==0:
        a//=i
    while b%i==0:
        b//=i
if a==b!=1:
    c+=1
print(c)