#include <bits/stdc++.h>
using namespace std;
using ll = long long;

struct SieveOfEratosthenes {
    vector<int> primes;
    vector<bool> isPrime;
    void build(ll n) {
        primes.clear();
        isPrime.assign(n + 1, true);
        isPrime[0] = isPrime[1] = false;
        ll k = 2;
        for (; k * k <= n; ++k) {
            if (!isPrime[k]) continue;
            primes.push_back(k);
            for (int m = k * 2; m <= n; m += k) isPrime[m] = false;
        }
        for (; k <= n; ++k) if (isPrime[k]) primes.push_back(k);
    }
    int operator [](int i) const { return primes[i]; }
    int size() const { return primes.size(); }
};

int main() {
    int n;
    SieveOfEratosthenes soe;
    while (~scanf("%d", &n)) {
        soe.build(n);
        printf("%d\n", soe.size());
    }
}
