#include<iostream>
#include<vector>
#include<algorithm>

using namespace std;
#define MAX_NUM 10000000
vector<int> p;
int flag[MAX_NUM/32+1];

//sieve eratosthenes
void setPrime(vector<int> &p){

    for(int i=1;2*i*(i+1)<(MAX_NUM>>1);++i){

        if(flag[i>>5] & (1<<(i%32)))continue;
        //(2*j+1) == (2*i+1)*(2*i+1)
        //(2*i+1)*(2*i+1) -> (2*i+1)*(2*(i+1)+1) -> ... set not prime
        for(int j=2*i*(i+1); j<(MAX_NUM>>1); j+=2*i+1)
            flag[j>>5] |= (1<<(j%32));

    }

    p.push_back(2);
    for(int i=1;2*i+1<=MAX_NUM;++i){
        for(;flag[i>>5] & (1<<i);++i);
        if(2*i+1>MAX_NUM)break;
        p.push_back(2*i+1);
    }

}

int ans[1000001];
int cnt = 0;

int main(){

    vector<int> primes;
    setPrime(primes);

    for(int i=0;i<=1000000;++i){

        if(primes[cnt]==i)++cnt;

        ans[i]=cnt;

    }

    int N;
    while(cin>>N){

        cout << ans[N] << endl;

    }

    return 0;
}