#include <iostream>
#include <vector>
using namespace std;

int sieveOfEratosthenes(int n) {
    vector<int> prime;
    vector<int> isPrime((unsigned long)n + 1, true);
    isPrime[0] = false, isPrime[1] = false;
    for (int i = 2; i <= n; i++) {
        if (isPrime[i]) {
            prime.push_back(i);
            for (int j = 2 * i; j <= n; j+= i)
                isPrime[j] = false;
        }
    }
    return (int)prime.size();
}

int main() {
    int n;
    while (cin >> n) {
        cout << sieveOfEratosthenes(n) << endl;
    }
    return 0;
}
