#include <stdio.h>
int main(){
    bool prime[1000000];
    int n,ans;
    prime[2]=true;
    for(int i=3;i<1000000;i+=2)prime[i]=true;
    for(int i=3;i<=1000;i+=2){
        if(prime[i]){
            for(int j=i*i;j<1000000;j+=i)
                prime[j]=false;
        }
    }
    while(scanf("%d",&n)!=EOF){
        ans=1;
        if(n<3){printf("%d\n",n-1);
            continue;}
    for(int i=3;i<=n;i+=2)if(prime[i])ans++;
        printf("%d\n",ans);
    }
}