#include <cstdio>
#include <cstdlib>
#include <vector>
using namespace std;

const int MAX = 1000000;

vector<bool> sieve(int n = MAX) {
	vector<bool> prime(n, true);
	prime[0] = prime[1] = false;
	for(int i = 2; i < n; ++i)
	if(prime[i])
		for(int j = i * 2; j < n; j += i)
			prime[j] = false;

	return prime;
}

int main() {
	vector<bool> prime = sieve();
	vector<int> num(MAX, 0);

	for(int i = 0; i < MAX - 1; ++i)
		num[i + 1] = num[i] + prime[i + 1];

	for(int n; scanf("%d", &n) == 1;)
		printf("%d\n", num[n]);

	return EXIT_SUCCESS;
}