import math N,K=map(int,input().split()) s=N-K ans=0 for i in range(1,int(math.sqrt(s))+1): if s%i==0: ans+=1 if s//i!=i: ans+=1 if K!=0: ans-=1 print(ans)