a,b=map(int, input().split()) c=[] for i in range(1, ((a-b)+2)//2): if (a-b) % i == 0: c.append(i) if b==0: print(len(c)+1) else: print(len(c))