#include<stdio.h>
#include<math.h>
int main(void)
{
	long long i,j,p,n,count;
	bool flag[1000000];
	while((scanf("%lld",&n)) != EOF)
	{
		p = (long long)sqrt((double)n);
		for(i = 3; i <= p; i = i + 2)
		{
			for(j = i * i; j <= n; j = j + 2 * i)
			{
				flag[j] = false;
				
			}
		}
		if(n == 1 || n == 0)
			count = 0;
		else
		{
			count = 1;
			for(i = 3; i <= n; i = i + 2)
			{
				if(flag[i])
					count++;
			}
		}
		printf("%lld\n",count);
	}

		
	return 0;
}