#include <iostream>
#include <vector>
#include <algorithm>
#include <cstdio>
#define REP0(i,n) for(int i=0;i<n;++i)
#define REP1(i,n) for(int i=1;i<=n;++i)
#define ALL(c) (c).begin(),(c).end()
using namespace std;
typedef long long ll;
const ll ccc=1000000;
bool prime[ccc+1];
vector<ll> pr;
int main(){
	ll iii,jjj;
	for(iii=0;iii<=ccc;iii++){
		prime[iii]=true;
	}
	prime[0]=false;
	prime[1]=false;
	for(iii=2;iii*iii<=ccc;iii++){
		if(prime[iii]){
			for(jjj=2*iii;jjj<=ccc;jjj+=iii){
				prime[jjj]=false;
			}
		}
	}
	for(iii=2;iii<=ccc;iii++){
		if(prime[iii]){
			pr.push_back(iii);
		}
	}
	int a;
	while(scanf("%d",&a)!=EOF) printf("%d\n",upper_bound(ALL(pr),a)-pr.begin());
	return 0;
}