#include <iostream>
#include <cmath>

using namespace std;

bool isprime_ge3(int n) {
	if (!(n&1))
		return false;
	int lim = (int)sqrt((double)n);
	for (int i = 3; i <= lim; i+=2)
		if (!(n%i))
			return false;
	return true;
}

int main(void) {
	int n;
	while (cin >> n) {
		if (n < 2)
			cout << 0 << endl;
		else if (n == 2)
			cout << 1 << endl;
		else {
			int total = 1;
			for (int i = 3; i <= n; i++) {
				if (isprime_ge3(i))
					total++;
			}
			cout << total << endl;
		}
	}
	return 0;
}