n,k = map(int,input().split()) ans = n-k def divisor_list_s(num): divisors = [] for i in range(1, int(num**0.5)+1): if num % i == 0: divisors.append(i) if i**2 == num: continue divisors.append(int(num/i)) return len(divisors)-1 print(divisor_list_s(ans))