#include <iostream>
#include <vector>
#include <queue>
#include <string>
#include <cstdio>
#include <cmath>
#include <sstream>
#include <algorithm>

using namespace std;

bool isPrime(int n) {
	if (n == 2)return true;
	if (n < 2 || n % 2 == 0) return false;
	int i = 3;
	while (i <= sqrt(n)) {
		if (n%i == 0) return false;
		i = i + 2;
	}
	return true;
}

int main() {
	int a, count;
	vector<int> v;
	for (int i = 0; i <= 999999;i++) {
		if (isPrime(i)) v.push_back(i);
	}

	while (cin >> a) {
		count = 0;
		for (int i = 0; i <v.size()+1; i++) {
			if (v.size() + 1 == i) {
				count = i;
				break;
			}
			if (v[i] > a) {
				count = i;
				break;
			}
		}
		cout << count << endl;
	}
}