#include<iostream>
#include<cmath>
using namespace std;
int main() {
	int n;
	while (cin >> n){
		int sum = 0;
		if (n >= 2)sum++;
		for (int i = 3; i <= n; i += 2) {
			for (int j = 3; j <= sqrt(i); j += 2) {
				if (i%j == 0)goto x;
			}
			sum++;
		x:;
		}
		cout << sum << endl;
	}
	return 0;
}