#include<iostream>
using namespace std;

int main() {
	int n,i,j,a=0,b=0;
	while (cin >> n) {
		if(n>=9) {
			for (i = 9; i <= n; i++) {
				a=0;
				for (j = 3; j <= n; j++) {
					if (i%j == 0) {
						a++;
						break;
					}
					j++;
					b += a;
				}
				i++;
			}
		}
		if (n == 2)cout << "1" << endl;
		else if (n == 3)cout << "2" << endl;
		else if (n == 5) cout << "3" << endl;
		else if (n == 7)cout << "4" << endl;
		else if (n % 2 == 0) cout << n / 2 - b - 1 << endl;
		else cout << (n + 1) / 2 - b - 1 << endl;
	}
	return 0;
}