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

#define pb push_back

using namespace std;

const int MAX=100000;
int main(void)
{
	int x;
	bool p[MAX];
	int cnt;
	int i1,i2;

	fill(p,p+MAX,false);

	for(i1=2;i1<MAX;i1++){
		for(i2=2;i2*i2<=i1;i2++){
			if(i1%i2==0) break;
		}
		if(i2*i2>i1) p[i1]=true;
	}

	while(cin>>x){
		cnt=0;
		for(i1=0;i1<=x;i1++){
			if(p[i1]) cnt++;
		}
		cout<<cnt<<endl;
	}
	return 0;
}