def calc_factors(number, prime_numbers): number_copied = number unique_factors = set() for candidate_factor in prime_numbers: while (number_copied % candidate_factor) == 0: unique_factors.add(candidate_factor) number_copied = number_copied / candidate_factor return unique_factors n, k = map(int, input().split()) count = 0 prime_numbers = set() success_numbers = set() for i in range(2, n + 1): success = False for s in success_numbers: if i % s == 0: success = True count += 1 break if success: success_numbers.add(i) success = False continue unique_factors = calc_factors(i, prime_numbers) # print("{} {}".format(i, unique_factors)) if len(unique_factors) >= k: success_numbers.add(i) count += 1 elif len(unique_factors) == 0: prime_numbers.add(i) print(count)