def make_divisors(n): lower_divisors , upper_divisors = [], [] i = 1 while i*i <= n: # print(n, i, n % i) if n % i == 0: if i > K: lower_divisors.append(i) if i != n // i: upper_divisors.append(n//i) i += 1 return lower_divisors + upper_divisors[::-1] N, K = list(map(int, input().split())) ans = make_divisors(N-K) # print(ans) print(len(ans))