#include <iostream>
#include <cmath>
using namespace std;

int main(void) {
    int N=999999;
    int p[N];
    p[0]=0;
    for (int i=1; i<N; i++){
        p[i] = 1;
    }
    for (int i=1; i<N; i++){
        if (p[i]==1){
            int n=i+1 , m=2*n;
            while (m<=N){
                p[m-1] = 0;
                m += n;
            }
        }
    }
    int n , s;
    while (1){
        cin >> n;
        s=0;
        if (cin.eof()){
            for (int i=0; i<n; n++){
                if (p[i]==1)
                    s+=1;
            }
            cout << s << endl;
        }
    }
    return 0;
}