#include<iostream>
#include<cstdio>
#include<cmath>
#include<string>
#include<deque>
#include<algorithm>
using namespace std;
//#define int long long

signed main(){
        deque<int> primes{2};

        for(int i=3;i<1000000;i+=2){
                for(unsigned int j=0;j<primes.size();j++){
                        if(primes[j]*primes[j]>i){
                                primes.push_back(i);
                                break;
                        }
                        if(i%primes[j]==0){
                                break;
                        }
                }
        }

        int a;
        while( scanf("%d", &a) != EOF ){
                cout<<distance(primes.begin(), upper_bound(primes.begin(),primes.end(),a))<<endl;
        }

        //int n;
        //scanf("%lld",&n);
        //for(int i=0;i<n;i++){}

        return 0;
}