#include <stdio.h>
#include <iostream>

using namespace std;

int solist[999999];

int main(int argc, char* argv[])
{
	int num;
	int count;
	int i, j;
	int val;

	count = 8;
	solist[0] = 2;
	solist[1] = 3;
	solist[2] = 5;
	solist[3] = 7;
	solist[4] = 11;
	solist[5] = 13;
	solist[6] = 17;
	solist[7] = 19;

	for (num = 3; num < 1000000; num += 2) {
		for (i = 0; i < count; i++) {
			if (num % solist[i] == 0) break;
		}
		if (i == count) solist[count++] = num;
	}

	while (cin >> val) {
		for (i = 0; i < count; i++) {
			if (solist[i] > val) {
				cout << i + 1 << endl;
				break;
			}
		}
		if (i == count) cout << count << endl;
	}
	
	return 0;
}