#include <iostream>
#include <vector>
using namespace std;
const int ub=1e6;

int main(){
	vector<bool> prime(ub, true);
	vector<int> numprime(ub, 0);
	for(int i=2; i<ub; i++){
		if(prime[i]){
			numprime[i] = numprime[i-1]+1;
			for(int j=2; i*j<ub; j++){
				prime[i*j]=false;
			}
		}else{
			numprime[i] = numprime[i-1];
		}
	}
	
	int n;
	while(cin>>n){
		cout << numprime[n] << endl;
	}
	return 0;
}