#include <iostream>
#include <vector>
using namespace std;

#define priMAX 1000000

vector<int> sieve_of_eratosthenes(int n) {
	vector<int> primes(n);
	for (int i = 2; i < n; ++i)
		primes[i] = i;
	for (int i = 2; i*i < n; ++i)
	if (primes[i])
		for (int j = i*i; j < n; j+=i)
			primes[j] = 0;
	return primes;
}

int main(){
	vector<int> primes = sieve_of_eratosthenes(priMAX);
	vector<int> all(priMAX);
	int cc = 0;
	for(int i=0; i<priMAX; i++){
		if(primes[i]) cc++;
		all[i] = cc;
	}
	int n;
	while(cin>>n){
		cout<<all[n]<<endl;
	}
	return 0;
}