#include <iostream>
using namespace std;
int main() {
	bool isprime[1000000];
	for (int i = 0; i < 1000000; i++)
		isprime[i] = 1;
	for (int i = 2; i < 1000; i++) {
		if (!isprime[i]) continue;
		for (int j = i * i; j < 1000000; j += i)
			isprime[j] = 0;
	}
	int n;
	while (cin >> n) {
		int ans = 0;
		for (int i = 2; i <= n; i++)
			if (isprime[i])
				ans++;
		cout << ans << endl;
	}
}
