#include "bits/stdc++.h"
using namespace std;

int main() {
	static bool Prime[1000000] = {};
	static int Count[1000000] = {};
	for (int i = 2; i < 1000000; i++) {
		Prime[i] = true;
	}
	for (int i = 2; i <= 1000; i++) {
		if (Prime[i]) {
			for (int j = 2; j <= 999999 / i; j++) {
				Prime[i * j] = false;
			}
		}
	}
	for (int i = 2; i < 1000000; i++) {
		Count[i] = Count[i - 1];
		if (Prime[i]) Count[i]++;
	}
	int N;
	while (cin >> N) {
		cout << Count[N] << endl;
	}
}
