#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<double, int>;

int main() {
    vector<bool> is_prime(1000000, true);
    vector<int> prime;
    is_prime[0] = is_prime[1] = false;
    for(int i=2; i<is_prime.size(); ++i) {
        if(is_prime[i]) {
            prime.push_back(i);
            for(int j=i+i; j<is_prime.size(); j+=i) {
                is_prime[j] = false;
            }
        }
    }
    int n;
    while(cin >> n) {
        cout << upper_bound(prime.begin(), prime.end(), n) - prime.begin() << endl;
    }
}
