#include<stdio.h>
#include<math.h>
#define MAX_S 999999

int main(void) {
	int prime_f[MAX_S], prime_sum[MAX_S], sum = 0, n;

	for (size_t i = 0; i < MAX_S; i++)
	{
		prime_f[i] = 1;
		prime_sum[i] = 0;
	}
	prime_f[0] = 0;

	for (size_t i = 1; i < sqrt(MAX_S); i++)
	{
		if (prime_f[i] == 1) {
			for (size_t j = i + 1; j*(i + 1) <= MAX_S; j++)
			{
				prime_f[(i + 1)*j - 1] = 0;
			}
		}
	}

	for (size_t i = 0; i < MAX_S; i++)
	{
		if (prime_f[i] == 1) sum++;
		prime_sum[i + 1] = sum;
	}

	while (scanf("%d", &n) != EOF)
	{
		printf("%d\n", prime_sum[n]);
	}
	return 0;
}