#include <memory.h>
#include <iostream>

using namespace std;

int main(int argc, char* argv[])
{
	int i;
	int pos;
	int val;
	int target;
	int sosuList[78499];

	memset(sosuList, 0, sizeof(sosuList));

	sosuList[0] = 2;
	sosuList[1] = 3;
	sosuList[2] = 5;
	sosuList[3] = 7;
	sosuList[4] = 11;

	while (cin >> target) {
		for (pos = 0; sosuList[pos] != 0; pos++) {
			if (sosuList[pos] > target) break;
		}
		for (val = sosuList[pos - 1] + 1 ; val <= target ; val++) {
			for (i = 0; i < pos - 1 ; i++) {
				if (sosuList[i] * 2 > val) { i = pos; break; }
				if (val % sosuList[i] == 0) break;
			}
			if (i >= pos - 1) sosuList[pos++] = val;
		}
		cout << pos << endl;
	}
	return 0;
}