#include <bitset>
#include <iostream>
#include <string>

using namespace std;

int main()
{
    bitset<999999 + 1> b;
    auto t = b;
    t.set();
    t[0] = false;
    t[1] = false;
    int i = 0;
    while (true) {
        bool done = false;
        while (!t[i]) {
            ++i;
            if (i == t.size()) {
                done = true;
                break;
            }
        }
        if (done) {
            break;
        }

        b[i] = true;
        for (int j = i; j < t.size(); j += i) {
            t[j] = false;
        }
    }

    string s;
    while (getline(cin, s)) {
        int n = stoi(s);
        int count = 0;
        for (int j = 1; j <= n; ++j) {
            if (b[j]) {
                ++count;
            }
        }
        cout << count << endl;
    }
}