#include <bits/stdc++.h>
#define int long long
using namespace std;
const int INF = 1e9 + 7, MOD = 1e9 + 7;
const long long LINF = 1e18;
const int dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1};
bool isPrime(long a) {
	if (a < 2) return false;
	long i;
	for (i = 2; i * i <= a; i++) {
		if (a % i == 0) return false;
	}
	return true;
}
signed main() {
	int Prime[1000000] = {};
	for (int i = 0; i < 1000000; i++) {
		if (isPrime(i)) {
			Prime[i] = 1;
		}
	}
	for (int i = 1; i < 1000000; i++) {
		Prime[i] += Prime[i - 1];
	}
	int n;
	while (cin >> n) {
		cout << Prime[n] << endl;
	}
	return 0;
}
