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