#pragma GCC target("avx2") #pragma GCC optimize("O3") #pragma GCC optimize("unroll-loops") #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; typedef long long ll; typedef pair P; typedef bitset<16> BS; struct edge { int to, cost, id; }; const double EPS = 1E-09; const ll MOD = 1E+09 + 7; // =998244353; const ll INF = 1E18; const int MAX_N = 2E+05; ll dx[4] = { -1, 1, 0, 0 }, dy[4] = { 0, 0, -1, 1 }; int N, K; ll spf[MAX_N + 1]; //spf[i]はiの素因数のうち最小のものを示す void smallest_prime_factor(ll n); int main() { ios::sync_with_stdio(false); cin.tie(nullptr); cin >> N >> K; smallest_prime_factor(N); int ans = 0; for (int i = 2; i <= N; i++) { // cout << "i = " << i << ", spf = " << spf[i] << "\n"; if (spf[i] >= K) ans++; } /* for (int i = 0; i < N; i++) { for (int j = 0; j < N; j++) { cout << "i = " << i << ", j = " << j << ", dp = " << dp[i][j] << "\n"; } } */ cout << ans << "\n"; return 0; } //n以下のspfを求める void smallest_prime_factor(ll n) { for (ll i = 2; i <= n; i++) { if (spf[i] == 0) { for (ll j = i; j <= n; j += i) { spf[j]++; } } } }