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

const int MAX = 1000000;

int main() {
	bool prime[MAX + 1];
	int sum[MAX + 1];
	fill(prime, prime + MAX + 1, true);
	fill(sum, sum + MAX + 1, 0);
	prime[0] = prime[1] = false;
	for(int i = 2; i <= MAX; i++) {
		sum[i] = sum[i - 1];
		if(prime[i]) {
			sum[i]++;
			for(int j = 2 * i; j <= MAX; j += i)
				prime[j] = false;
		}
	}
#if 0
	for(int i = 1; i < 20; i++) {
		cout << i << " " << sum[i] << endl;
	}
#endif
	for(int n; cin >> n;)
		cout << sum[n] << endl;
	return 0;
}