#include <iostream>

using namespace std;

int main()
{
	int num[1000000];
	for (int i = 0; i < 1000000; i++) {
		num[i] = 1;
	}
	num[0] = 0;
	num[1] = 0;

	for (int i = 2; i < 1000000; i++) {
		for (int j = 2; i * j < 1000000; j++) {
			num[i * j] = 0;
		}
	}

	int n;
	while (cin >> n) {
		int ans = 0;
		for (int i = n; i >= 2; i--) {
			if (num[i]) {
				ans++;
			}
		}
		cout << ans << endl;
	}
	
	return 0;
}