#include<iostream>
using namespace std;
int main()
{
	bool p[1000000] = { false };
	int n;
	for (int i = 2; i <1000000; i++){
		for (int i2 = 2; i*i2 <= 1000000; i2++){
				p[i*i2] = true;
			}
		}
		p[2] = false;
		p[3] = false;
	while (cin >> n){
		
		
		int c = 0;
		for (int i = 2; i <= n; i++){
			if (!p[i])c++;
		}
		cout << c << endl;
	}
}