#include<iostream>
#include<vector>

int main() {
	std::vector<bool> isPrime(1000000, true);
	std::vector<int> numP(1000000, 0);

	isPrime[0] = false;
	isPrime[1] = false;

	for (int i = 2; i < 1000000; i++) {
		if (isPrime[i]) {
			numP[i] = numP[i - 1] + 1;
			for (int x = 2; i*x < 1000000; x++) {
				isPrime[i*x] = false;
			}
		}
		else {
			numP[i] = numP[i - 1];
		}
	}

	int input;
	while (std::cin >> input) {
		std::cout << numP[input] << std::endl;
	}
	return 0;
}