#include<iostream>
#include<vector>
using namespace std;

class prime{
	int cnt;
	vector<int> p;
public:
	prime();
	int num(int n);
};

prime::prime(){
	p.clear();
}

int prime::num(int n){
	if(n<2)return 0;
	if(n==2)return 1;
	p.push_back(2);
	int c;
	cnt=1;
	for(int i=3;i<=n;i+=2){
		c=0;
		for(int j=0;j<(int)p.size();j++){
			if(i%p[j]==0){
				c++;
				break;
			}
		}
		if(c==0){
			p.push_back(i);
			cnt++;
		}
	}
	return cnt;
}

int main()
{
	int n;
	while(cin >> n){
		prime pr;
		cout << pr.num(n) << endl;
	}
	return 0;
}