N, K = map(int, input().split()) ans = 0 for i in range(K+1,(N-K)//2+1): if K != 0: if N % i != 0 and (N-K)%i == 0: ans += 1 else: if N % i == 0 and (N-K)%i == 0: ans += 1 print(ans+1)