#include <iostream>
#include <vector>
#include <cstdint>

int main()
{
	std::uint32_t n;
	while (std::cin >> n) {
		std::uint32_t num_prime = (n > 1) ? 1 : 0;
		std::vector<std::uint8_t> is_prime(n / 2, true);
		for (std::uint32_t i = 3; i < n + 1; i += 2) {
			if (is_prime[i / 2 - 1]) {
				++num_prime;
				for (std::uint32_t j = 3 * i; j < n + 1; j += i + i) {
					is_prime[j / 2 - 1] = false;
				}
			}
		}
		std::cout << num_prime << std::endl;
	}
	return 0;
}