#include <iostream>
#include <cmath>

using namespace std;

int main() {
	bool a[1000000] = {1,1};
	int n, i, j, f = 0, count = 0;
	while (cin >> n) {
		f = 0;
		count = 0;
		while (f <= ceil(sqrt(n))) {
			i = f + 1;
			while (a[i] == 1) {
				i++;
			}
			f = i;
			for (j = i + 1; j <= n; j++) {
				if (j % f == 0) a[j] = 1;
			}
		}
		for (i = 0; i <= n; i++) {
			if (a[i] == 0) { count++;}
		}
		cout << count << endl;
	}
}