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

int main()
{
	int n, i,j,k,cnt;
	while (scanf("%d", &n) != EOF)
	{
		cnt = 0;
		if (n <= 1)
		{
			printf("0\n");
			continue;
		}
		if (n == 2)
		{
			printf("1\n");
			continue;
		}
		if (n <= 4)
		{
			printf("2\n");
			continue;
		}
		for (j = 5; j <= n; j+=2)
		{
			k = 0;
			for (i = 3; i <= sqrt(j*1.0); i += 2)
			{
				if (j%i == 0)
				{
					k = -1;
					break;
				}
			}
			if (k == -1)continue;
			cnt++;
		}
		printf("%d\n", cnt + 2);
	}
}