#include<iostream>
#include<vector>
#include<algorithm>

using namespace std;
const int N=1000000;
vector<bool> pr(N,true);
vector<int> p;

void init()
{
	int i,j;
	p.reserve(80000);
	p.push_back(2);
	for(i=3;i*i<N;i+=2)
		if(pr[i]) {
			p.push_back(i);
			for(j=i;i*j<N;j+=2) pr[i*j]=false;
		}
	for(;i<N;i+=2) if(pr[i]) p.push_back(i);
}

int main()
{
	int n;
	init();
	while(cin>>n) {
		cout<<upper_bound(p.begin(),p.end(),n)-p.begin()<<endl;		
	}
	return 0;
}
