#include<cstdio>
#include<cmath>
using namespace std;
bool book[1000000];
int search[1000000];
int main()
{
	int n,x=0;
	
	int m=floor(sqrt(999999)+0.5);
	for(int i=2;i<=m;i++)
	{
		if(book[i]==false)
		{
			search[i]=++x;
			for(int j=2*i;j<=999999;j+=i)
				book[j]=true;
		}
		else
			search[i]=x;
	}
	for(int i=m+1;i<=999999;i++)
	{
		if(book[i]==false)
			search[i]=++x;
		else
			search[i]=x;
	}
	
	while(~scanf("%d",&n))
	{
		printf("%d\n",search[n]);
	}
	return 0;
}
