#include<iostream>

using namespace std;

int main(){
	int n;
	bool p[1000000] = { true };
	int ans[1000000] = { 0 };
	p[0] = false;
	p[1] = false;

	for (int i = 2; i < 1000; i++){
		if (p[i]){
			for (int j = i*i; j < 1000000; j+=i){
				p[j] = false;
			}
		}
	}

	for (int i = 0; i < 1000000; i++){
		ans[i] += p[i];
	}

	while (cin >> n)
		cout << ans[n] << endl;

}