#include"stdio.h"
#define nmax 1000000
int ans[nmax];
bool is_prime[nmax + 1];

void sieve(int n) {
	int p = 0;
	for (int i = 0; i <= n; i++)is_prime[i] = true;
	is_prime[0] = is_prime[1] = 0;
	ans[0] = ans[1] = 0;
	for (int i = 2; i <= n; i++) {
		if (is_prime[i]) {
			p++;
			for (int j = 2 * i; j <= n; j += i)is_prime[j] = false;
		}
		ans[i] = p;
	}
}
int main()
{
	sieve(nmax);
	int n,m=0;
	for (; scanf("%d", &n) == 1;) {
		printf("%d\n", ans[n]);
	}
	return 0;
}
