#include <iostream>
#include <cmath>
#include <ctime>

using namespace std;

bool judge_Prime_num(const int& num) {
	if (num < 2)
		return false;
	else if (num == 2)
		return true;
	else if (num % 2 == 0)
		return false;

	double sqrtnum = sqrt(num);
	for (int i = 3; i <= sqrtnum; i += 2) {
		if (num%i == 0)
			return false;
	}
	return true;
}

int main() {
	int n;
	while (cin >> n) {
		//clock_t start = clock();
		int tmp = n;
		int cnt = 0;
		while (tmp > 1) {
			if (tmp != 2 && tmp % 2 == 0) {
				--tmp;
				continue;
			}
			if (judge_Prime_num(tmp)) {
				++cnt;
			}
			--tmp;
		}
		cout << cnt << endl;
		//clock_t end = clock();
		//cout << cnt << "     " << (double)(end - start) / CLOCKS_PER_SEC << "sec" << endl;
	}
}
