#include <algorithm>
#include <iostream>
#include <vector>
#include <cmath>
using namespace std;
typedef vector <int> vi;
vi primes;

int get_primes(int max){
	int n = (max+1)/2;
	int root = (int)(pow(n, 0.5));
	vector <bool> numbers(n, true);
	numbers[0]=false;

	if (max>1) primes.push_back(2);
	for (int i=1; i<root; i++){
		int tmp = i*2+1;
		if (numbers[i]){
			primes.push_back(tmp);
			for (int j=i+tmp; j<n+1; j+=tmp){
				numbers[j]=false;
			}
		}
	}
	for (int i=root; i<n+1; i++){
		if(numbers[i]){
			primes.push_back(2*i+1);
		}
	}
	return 0;
}

int main(void){
	vi n;
	int nmax=0;
	while (true){
		int tmp;
		cin>>tmp;
		if (cin.eof()) break;

		n.push_back(tmp);
		if (tmp>nmax) nmax=tmp;
	}

	get_primes(nmax);
	for (int i=0; i<n.size(); i++){
		cout<<upper_bound(primes.begin(), primes.end(), n[i]) - primes.begin()<<endl;
	}
	return 0;
} 