#include<iostream>
#include<stdio.h>
using namespace std;
typedef long long ll;
const ll MAX=1e6;
ll prime[MAX+2],mark[MAX+2],ans[MAX+2];
void Prime(){
    memset(mark,0,sizeof(mark));
    ll index=0;
    for(ll i=2;i<=MAX;i++){
        if(mark[i]) continue;
        else{
            prime[++index]=i;
            for(ll j=i*i;j<=MAX;j+=i){
                mark[j]=1;
            }
        }
    }
}
int main(){
    ll a;
    memset(ans,0,sizeof(ans));
    Prime();
    for(int i=2;i<=MAX-2;i++){
        if(mark[i]==0) ans[i]=ans[i-1]+1;
        else ans[i]=ans[i-1];
    }
    while(scanf("%I64d",&a)!=EOF){
        cout<<ans[a]<<endl;;
    }
    return 0;
}