#include <iostream>
#include <cmath>
using namespace std;

int main() {
	int n, ans;
	while (cin >> n) {
		ans = 2;
		if (n == 2) { cout << "1" << endl; continue; }
		if (n == 3) { cout << "2" << endl; continue; }
		for (int i = 4; i <= n; i++) {
			if (i % 2 == 0 || i % 3 == 0) continue;
			if (i % 6 != 1 && i % 6 != 5) continue;
			for (int i = 5; pow(i, 2) <= n; i += 6)
				if (n % i == 0 || n % (i + 2) == 0) continue;
			ans++;
		}
		cout << ans << endl;
	}
	return 0;
}
