#include<stdio.h>
#include<math.h>
#include<stdlib.h>

int main()
{
	int n, i, j, k=1, wareru=0,cnt;
	long int *sosu = (long int*)malloc(sizeof(long int) * 1000000);
	sosu[0] = 2;
	for (i = 3; i < 1000000; i += 2)
	{
		wareru = 0;
		for (j = 3; j <= sqrt(i*1.0); j += 2)
		{
			if (i%j == 0)
			{
				wareru = 1;
				break;
			}
		}
		if (wareru == 0)
		{
			sosu[k++] = i;
		}
	}

	while (scanf("%d", &n) != EOF)
	{
		if (n == 1)
		{
			printf("0\n");
			continue;
		}
		if (n == 2)
		{
			printf("1\n");
			continue;
		}
		for (i = 0; sosu[i] <= n; i++);
		printf("%d\n", i);
	}
}