#include<iostream>
#include<stdio.h>
#include<cmath>
#include<queue>
#include<algorithm>
using namespace std;

int main(void){
    int n,i,j,sosu[999999],ans=0;
    for(i=0;i<999999;i++) sosu[i]=1;
    sosu[0]=0;
    for(i=2;i<=999999;i++){
        if(sosu[i-1]==1){
            for(j=i*2;j<=999999;j+=i){
                sosu[j-1]=0;
            }
        }
    }
    while(cin >> n){
        ans=0;
        for(i=0;i<n;i++){
            ans+=sosu[i];
        }
        cout << ans << endl;
    }
    return 0;
}