#include <iostream>
#include <vector>
#include <cstdio>

using namespace std;

vector<int> a(1000000, 1);

int main(void)
{
	a[0] = a[1] = 0;
	for (int i = 2; i < 1000000; i++) {
		if (a[i]) {
			for (int j = i * 2; j < 1000000; j += i) {
				a[j] = 0;
			}
		}
	}
	for (int i = 1; i < 1000000; i++) {
		a[i] += a[i - 1];
	}

	int n;
	while (scanf("%d", &n) != EOF) {
		cout << a[n] << endl;
	}

	return 0;
}
