#include<bits/stdc++.h>
using namespace std;
int a[1000005] = {0,};
vector<int> primeVec;
void genPrime(){
	for (int i=2;i<=1000000;i++){
		if (a[i]) continue;
		else{
			a[i] = 2;
			primeVec.push_back(i);
			if (i >= 1000) continue;
			for (int j=i*i;j<=1000000;j+=i) a[j] = 1;
		}
	}
}
int main(){
	genPrime();
	int n;
	while(cin >> n)
		cout << upper_bound(primeVec.begin(), primeVec.end(), n) - primeVec.begin() << endl;
	return 0;
}
