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

struct theSieveOfEratosThenes {
	vector<bool> prm;

	theSieveOfEratosThenes(int n) {
		prm = vector<bool>(n + 1, true);
		prm[0] = prm[1] = false;
		for (int i = 2; i * i <= n; ++i) {
			if (prm[i]) {
				for (int j = 2 * i; j <= n; j += i) prm[j] = false;
			}
		}
	}

	bool isPrimeNumber(int a) {
		return prm[a];
	}
};

int main() {
	int n;
	theSieveOfEratosThenes tsoet(999999);
	while (cin >> n) {
		int ans = 0;
		for (int i = 2; i <= n; ++i) {
			if (tsoet.isPrimeNumber(i)) ++ans;
		}
		cout << ans << endl;
	}
}
