N, K = map(int, input().split()) primes = [] N -= K ans = 0 for i in range(1, int(N ** 0.5) + 1): if N % i == 0: if i <= K: ans += 1 elif N // i > K: ans += 2 print(ans)