#include <iostream>
using namespace std;
#define n_size 1000000

int main(){
    bool isPrime[n_size];
    isPrime[0]=false; isPrime[1]=false;

    for(unsigned i=2;i<n_size;i++)
        isPrime[i] = true;

    for(unsigned i=2;i*i<n_size;i++){
        if(isPrime[i]){
            for(unsigned j=(i*i);j<n_size;j+=i)
                isPrime[j] = false;
        }
    }

    unsigned n_prime[n_size];

    unsigned cnt = 0;
    for(unsigned i=0;i<n_size;i++){
        if(isPrime[i])
            cnt++;
        n_prime[i] = cnt;
    }

    unsigned n;
    while(cin>>n){
        cout << n_prime[n] << endl;
    }

    return 0;
}
