#include using namespace std; typedef long long ll; template size_t prime_sieve(ForwardIterator start, ForwardIterator end) { if (start == end) return 0; std::fill(start, end, 0); for (ForwardIterator prime_it = start + 1; prime_it != end; ++prime_it) { if (*prime_it == 1) continue; size_t stride = (prime_it - start) + 1; ForwardIterator mark_it = prime_it; while ((end - mark_it) > stride) { std::advance(mark_it, stride); *mark_it = 1; } } ForwardIterator out_it = start; for (ForwardIterator it = start + 1; it != end; ++it) { if (*it == 0) { *out_it = (it - start) + 1; ++out_it; } } return out_it - start; } int main(void) { #ifdef DEBUG freopen("input.txt", "r", stdin); #endif ios_base::sync_with_stdio(false); cin.tie(NULL); long N; cin >> N; int K; cin >> K; vector primes(N); size_t count = prime_sieve(primes.begin(), primes.end()); long n[N+1]; for (long i = 0; i < N + 1; i++) n[i] = 0; for (size_t i = 0; i < count; ++i) { int j = 1; while (1) { if (primes[i] * j <= N) n[primes[i]*j] += 1; else break; j++; } } long ans = 0; for (long i = 0; i < N + 1; i++) { if (n[i] >= K) ans++; } cout << ans << endl; return 0; }