N,K = map(int,input().split()) M = N-K divs = set() m = 1 while m*m <= M: if M%m==0: divs.add(m) divs.add(M//m) m += 1 ans = 0 for d in divs: if d > K: ans += 1 print(ans)