#include<stdio.h>
#include<math.h>
#define N 1000000
int main(void) {
	int prime[N] = { 0 }, sums[N] = { 0 }, n, sum = 0;
	prime[1] = 1;
	for (size_t i = 2; i <= sqrt(N); i++)
	{
		if (prime[i] == 0)
		{
			sum++;
			sums[i] = sum;
			for (size_t t = i + 1; t <= N; t++)
			{
				sums[t] = sum;
				if (t%i == 0)prime[t] = 1;
			}
		}
	}
	while (scanf("%d", &n) != EOF) {
		printf("%d\n", sums[n]);
	}
	return 0;
}