#include <bits/stdc++.h>

const static double	de_PI	= 3.14159265358979323846;
const static int	de_MOD	= 1000000007;
const static int	de_MAX	= 999999999;
const static int	de_MIN = -999999999;

bool Judge_PrimeNumber(const int a) {

	if (a < 2) { return false; }
	if (a == 2) { return true; }
	if (a % 2 == 0) { return false; }

	for (int i = 3; i <= a / i; i += 2) {
		if (a%i == 0) {
			return false;
		}
	}
	return true;
}

int main(void) {

	//std::ifstream in("123.txt");	std::cin.rdbuf(in.rdbuf());

	int n = 0, ans = 0;
	std::vector<int> A;

	while (std::cin >> n) {
		A.push_back(n);
	}

	for (unsigned int i = 0; i < A.size(); i++) {

		if (n == 1) {
			std::cout << 0 << std::endl;
			continue;
		}
		ans = 1;
		for (int j = 3; j <= A[i]; j += 2) {
			if (Judge_PrimeNumber(j)) {
				ans++;
			}
		}
		std::cout << ans << std::endl;
	}

}