#include <iostream>
using namespace std;

int main()
{
	int n = 0, x = 0;
	int countdata[1000];
	while (cin >> n) {
		int count = 0;
		for (int a = 2; a <= n; a++) {
			int count2 = 0;
			if (a % 2 != 0 && a % 3 != 0 && a % 5 != 0 && a % 7 != 0) {
				count++;
			}
			else {
				for (int b = 2; b <= a / 2; b++) {
					if (a%b != 0)
						count2++;
				}
				if (count2 == a / 2 - 1)
					count++;
			}
		}
		countdata[x] = count;
		x++;
	}
	for (int a = 0; a < x; a++) {
		cout << countdata[a] << endl;
	}
}