#include<iostream>
#include<string>
#include<vector>
using namespace std;

bool prime(int a) {
	for (int b = 3;; b += 2) {
		if (a%b == 0)return false;
		if ((b + 1)*(b + 1) > a)return true;
	}
}
int main() {
	while (1) {
		int s = 0;
		int a;
		cin >> a;
		if (cin.fail())break;
		if (a > 1)s++;
		if (a > 2)s++;
		for (int b = 5; b <= a; b+=2) {
			if (prime(b))s++;
		}
		cout << s << endl;
	}
}