#include <stdio.h>

int CheckPrime(int n);
int main(void)
{
	static int IsPrime[1000000];
	int i, n, ans;

	for(i=0; i<=999999; i++)
		IsPrime[i]=-1;

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

int CheckPrime(int n)
{
	int i;
	if(n <= 1)return 0;
	if(n == 2)return 1;
	if(n%2==0)return 0;

	for(i=3; i*i<=n; i++)
		if(n%i == 0)return 0;

	return 1;
}