#include<iostream>
#include<algorithm>
using namespace std;
int main() {
	long long n, a, b,c;
	b = 0;
	while (cin >> a) {
		for (c = 1; c <=a; c++) {
			for (int j = 2; j*j <= c; j++) {
				if (c%j == 0) {
					b++;
					break;
				}
			}
		}
		cout << a - b - 1 << endl;
		b = 0;
	}
	return 0;
}