#include <iostream>

using namespace std;
int main(void){
    int n;
    int count;
    int prime[1000000];
    int i,j;
    while(cin>>n){
        count=0;
        fill(prime,prime+1000000,0);
        prime[0]=prime[1]=1;
        for(i=2;i<=n;i++){
            if(prime[i]==0){
                count++;
                for(j=2*i;j<=n;j+=i){
                    prime[j]=1;
                }
            }
        }
        cout<<count<<endl;
    }
    return(0);
}