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

int main() {
	int N;
	while (cin >> N) {
		vector<int> v(N + 1, 1);
		v.at(0) = 0;
		v.at(1) = 0;

		int r = sqrt(N);
		for (int i = 2; i <= r; i++) {
			int& p = v.at(i);
			if (p == 1) {
				for (int j = i*2; j <= N; j+=i) {
					int& p2 = v.at(j);
					if (!(j % i)) {
						p2 = 0;
					}
				}
			}
			else {
				continue;
			}
		}

		int c = count(v.begin(), v.end(), 1);
		cout << c << endl;
	}
}
