#include<iostream>
#include<cmath>
using namespace std;
bool isprime(int n) {
	if (n == 2)return true;
	if (n % 2 == 0)return false;
	for (int i = 3; i <= sqrt(n); i += 2) if (n%i == 0)return false;
	return true;
}
int main() {
	long prime[80000];
	prime[0] = 2;
	int num = 1;
	for (int i = 3; i < sqrt(1000000); i += 2) {
		if (isprime(i)) {
			prime[num] = i;
			num++;
		}
	}
	long n; while (cin >> n) {
		int j = 0;
		for (; prime[j] <= n; j++) {}
		cout << j << endl;
	}
	return 0;
}