#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>

using namespace std;
static const double EPS = 1e-10;

int main(){
	vector<int> p;
	vector<int> a(1000000);
	bool b;
	int n = 1000000;

	a[0] = a[1] = 0;
	a[2] = 1;
	p.push_back(2);
	for(int i = 3; i < n; i++){
		b = true;
		for(int j = 0; j < p.size(); j++){
			if(p[j]*p[j] > i){
				break;
			}
			if(i % p[j] == 0){
				b = false;
				break;
			}
		}
		if(b){
			p.push_back(i);
		}
		a[i] = p.size();
	}

	while(cin >> n){

		cout << a[n] << endl;
	}

	return 0;
}