#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #define fix(n) cout<; const ll MOD = 1000000007; // 10^9 + 7 const int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1}; const int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1}; // 正の整数n未満の素数を全て求める vector sieve(ll n) { vector is_prime(n); rep(i, n) is_prime[i] = true; is_prime[1] = false; for (ll i = 4; i < n; i += 2) is_prime[i] = false; ll lim = ll(sqrt(n)); for (ll i = 3; i <= lim; i += 2) { for (ll j = 3; i * j < n; j += 2) { is_prime[i * j] = false; } } vector ret; for (ll i = 1; i < n; i++) { if (is_prime[i]) ret.push_back(i); } return ret; } void solve() { const ll MAX = 2 * 1000000; vector p = sieve(MAX); vector nums(MAX+1, 0); for (ll pi : p) for (int i = pi; i <= MAX; i += pi) nums[i]++; ll N, K; cin >> N >> K; ll ans = 0; for (int i = 1; i <= N; i++) { if (nums[i] >= K) ans++; } outl(ans); } signed main() { cin.tie(0); ios::sync_with_stdio(false); srand((unsigned)time(NULL)); fix(12); solve(); }