#include<cstdio>
#include<iostream>
#include<algorithm>
#include<vector>
using namespace std;
bool prime[1000100]={0};
int main(){
    int N;
    prime[1]=1;
    for(int i=2;i*i<1000000;i++){
        if(prime[i]==0){
            for(int j=i;j<1000000;j+=i){
                prime[j]=1;
            }
        prime[i]=0;
        }
    }
    while(~scanf("%d",&N)){
        int cnt=0;
        for(int i=1;i<=N;i++){
            if(prime[i]==0)cnt++;
        }
        cout<<cnt<<endl;
    }
    return 0;
}