#include <algorithm>
#include <cstring>
#include <stdio.h>
#include <vector>;
using namespace std;
const int maxn = 1e6+100;
bool prim[maxn];
vector <int> ve;

void get_prim() {
    prim[0] = prim[1] = true;
    for(int i=2;i<maxn;i++) {
        if(prim[i])
            continue;
        ve.push_back(i);
        for(int j=i*2;j<maxn;j+=i) {
            prim[j] = true;
        }
    }
}

int main() {
    int n;
    get_prim();
    while(scanf("%d",&n) != EOF) {
        int pos = lower_bound(ve.begin(),ve.end(),n) - ve.begin();
        if(ve[pos] > n)
            pos--;
        printf("%d\n",pos+1);
    }
    return 0;
}
