#include <iostream>

using namespace std;

const int MAX = 1000000;
bool p[MAX];
int num[MAX];

void prepare() {
    for (int i=0; i<MAX; ++i) p[i] = true;
    p[0] = p[1] = false;
    for (int i=2; i*i<MAX; ++i) {
        if ( ! p[i]) continue;
        for (int j=i*i; j<MAX; j+=i) {
            p[j] = false;
        }
    }
    int sum = 0;
    for (int i=0; i<MAX; ++i) {
        if (p[i]) sum ++;
        num[i] = sum;
    }
}

int main() {
    prepare();
    int n;
    while (cin >> n) {
        cout << num[n] << endl;
    }
    return 0;
}