#include <iostream>
#include <vector>
#include <iterator>
#include <cmath>

using namespace std;

typedef long long ll;

int main()
{
	ll n;
	vector<ll> pl;
	back_insert_iterator<vector<ll> > it(pl);
	
	while(cin>>n){
		//ú»
		pl.clear();
		//nª2ÈºÌÆ«Ì
		if(n < 2){
			cout<<0<<endl;
			continue;
		}
		//â¿Ìì¬
		*it = 2;
		for(ll i = 3; i <= sqrt((long double)n); i++){
			for(ll t = 0; t < pl.size(); t++){
				if(i % pl[t] == 0) break;
				if(t == pl.size() -1) *it = i;
			}
		}
		//â¿É©¯é
		int L = pl.size();
		for(ll i = sqrt((long double)n) +1; i <= n; i++){
			for(ll t = 0; t < L; t++){
				if(i % pl[t] == 0) break;
				if(t == L -1) *it = i;
			}
		}
		cout<< pl.size() <<endl;
	}
}