a,b=list(map(int,input().split())) if a%b==0: n=1 for i in range(a//b): if a%(b*i)==0: n+=1 else: n=0 print(n)