def count(n): m = int(n ** 0.5) + 2 cnt = 0 for i in range(1,m): if n % i == 0: if i > k: cnt += 1 if n // i != i and n // i > k: cnt += 1 return cnt n,k = map(int,input().split()) ans = count(n-k) print(ans)