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

int eratosthenes(int n, vector<bool>& prime) {
    int ret = 0; prime.assign(n, false);
    vector<bool> chk(n, false);
    for (auto i = 2; i < n; i++) {
        if(chk[i]) continue;
        ret++; prime[i] = true;
        for (auto j = i; j < n; j += i) chk[j] = true;
    }
    return ret;
}

int main(){
    vector<bool> prime; eratosthenes(1000000, prime);
    vector<int> cnt(1000000, 0);
    for (auto i = 0; i < 1000000; i++) {
        if(prime[i]) cnt[i]++;
        cnt[i + 1] += cnt[i];
    }

    string s;
    while(cin >> s){
        int n = stoi(s);
        cout << cnt[n] << endl;
    }
    return 0;
}
