#include<iostream>
#include<math.h>
using namespace std;
int main() {
	int n,u,v,sum;
	double t;
	while (cin >> n) {
		sum = 0;
		for (int i = 1; i <= n; i++) {
			v = 0;
			t = sqrt(i) / 2;
			if (i > 7 && (i % 2 == 0 || i % 3 == 0 || i % 5 == 0)) {
				sum += 0;
			}
			else {
				for (int j = 0; j <= t; j++) {
					u = 2 * j + 1;
					if (i%u == 0) {
						v += 1;
					}
				}
			}
			while (v == 1) {
				sum += 1;
				break;
			}
		}
		if (n > 3) {
			cout << sum - 2 << endl;
		}
		else if(n==2||n==3) {
			cout << n-1 << endl;
		}
		else if (n == 1) {
			cout << 0 << endl;
		}
	}
	return 0;
}