program sample
    implicit none
    character(100)::s,t
    integer(8) :: i,j,k,m,n,ans
    integer(8)::a,b,c,d
    integer(8),allocatable::y(:)
  
    read(*,*) a,b
    c=min(a,b)
    d=max(a,b)
    a=c
    b=d
    if(a==1)then
        write(*,*)1
        stop
    end if
    do i=1,1000
        c=mod(b,a)
        b=a
        a=c
        if(a==0)then
            exit
        end if
    end do
    a=b
    
    c=0
    ans=1
    do i=2,b/2+2
        c=0
        do j=1,100
            if(mod(a,i)==0)then
                a=a/i
                if(c==0)then
                    c=1
                    ans=ans+1
                end if
            else
                exit
            end if
        end do
        if(a==1)then
            exit
        end if
    end do
    write(*,*)ans


   
    stop
end program sample
  

