N, K = map(int, input().split()) a = 0 if K == 0: a += 1 for i in range(1, N): if N % i == K: a += 1 print(a)