#include <iostream>

using namespace std;

bool array[1000000];
int main()
{
	int n;
	array[0] = true;
	array[1] = true;
	n = 1000000;
	for (int i = 2; i < n; i++) {
		if (array[i] == false){
			for (int j = i * 2; j < n; j += i) {
				array[j] = true;
			}
		}
	}
	while (cin >> n){
		int pri = 0;
		for (int i = 0; i <= n; i++){
			if (array[i] == false) {
				pri++;
			}
		}
		cout << pri << endl;
	}
}