#include <iostream>
#include <vector>
using namespace std;
const int N = 1000000;
int main(){
	int n;
	vector<bool> v(N,true);
	v[0] = false;
	v[1] = false;
	for (int i=2; i<N; ++i){
		if (v[i] == true){
			for (int j=2*i; j<N; j+=i){
				v[j] = false;
			}
		}
	}
	vector<int> cnt(N);
	for (int i=2; i<N; ++i){
		if (v[i]) cnt[i] = cnt[i-1]+1;
	   else cnt[i] = cnt[i-1];
	}
	while (cin >> n){
		cout << cnt[n] << '\n';
	}
	return 0;
}
