#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;

int main()
{
	int prime[1000000];
	bool is_prime[1000000];
	is_prime[0] = is_prime[1] = false;
	for (int i = 2; i < 1000000; i++)
		is_prime[i] = true;
	for (int i = 2; i*i < 1000000; i++) {
		if (is_prime[i]) {
			for (int j = i*i; j < 1000000; j += i) {
				is_prime[j] = false;
			}
		}
	}
	
	int count = 0;
	for (int i = 0; i < 1000000; i++) {
		if (is_prime[i])
			count++;
		prime[i] = count;
	}
	int n;
	while (cin >> n) {
		cout << prime[n] << endl;
	}
	return 0;
}