a,b=map(int,input().split())
from fractions import *
g=gcd(a,b)
c=i=1
while g>1 and i*i<=g:
    i+=1
    if g%i==0:
        c+=1
    while g%i==0:
        g//=i
print(c+(g>1)) a,b=map(int,input().split()) a map(int,input().split()) map int input().split() ().split () input split b from fractions import * g=gcd(a,b) g gcd(a,b) gcd a b c=i=1 c 1 =i=1 i 1 while g>1 and i*i<=g:
    i+=1
    if g%i==0:
        c+=1
    while g%i==0:
        g//=i g>1 and i*i<=g g>1 g 1 i*i<=g i*i i i g i+=1 i 1 if g%i==0:
        c+=1
     g%i==0 g%i g i 0 c+=1 c 1 while g%i==0:
        g//=i g%i==0 g%i g i 0 g//=i g i print(c+(g>1)) print c+(g>1) c g>1 g 1 i=1 1 i c+=1 1 c i+=1 1 i g=gcd(a,b) gcd(a,b) g g//=i i g a,b=map(int,input().split()) map(int,input().split()) a c=i=1 1 c b=map(int,input().split()) map(int,input().split()) b
a,b=map(int,input().split())
from fractions import *
g=gcd(a,b)
c=i=1
while g>1 and i*i<=g:
    i+=1
    if g%i==0:
        c+=1
    while g%i==0:
        g//=i
print(c+(g>1))