#include <iostream>
#include <math.h>
using namespace std;
int main() {
	unsigned long long int i;
	int n, p, cnt,fg;
	while (cin >> n) {
		i = 3;
		cnt = 1;
		fg = 0;	
		
		if ((int)log10(n) == 3) {
			cnt = 168;
			i = 1001;
		}
		else if ((int)log10(n) == 4) {
			cnt = 1229;
			i = 10001;
		}
		else if ((int)log10(n) == 5) {
			cnt = 9592;
			i = 100001;
		}
		if (110000<n) {
			cnt = 10453;
			i = 110001;
		}
		if (120000 < n) {
			cnt = 11301;
			i = 120001;
		}
		if (130000 < n) {
			cnt = 12159;
			i = 130001;
		}
		if (140000<n) {
			cnt = 13010;
			i = 140001;
		}
		if (150000<n) {
			cnt = 13848;
			i = 150001;
		}
		if (160000<n) {
			cnt = 14683;
			i = 160001;
		}
		if (170000<n) {
			cnt = 15493;
			i = 170001;
		}
		if (180000<n) {
			cnt = 16342;
			i = 180001;
		}
		if (190000<n) {
			cnt = 17170;
			i = 190001;
		}



		for (; i <= n; i+=2) {
			for (int j = 3; j <= (int)sqrt(i); j += 2) {
				if (i%j == 0) {
					fg = 1;
					break;
				}
			}
			if (fg)
				fg = 0;
			else
				cnt++;
		}
		if (n == 1)
			cnt--;
		cout << cnt << endl;
	}

	return 0;
}
