#include<bits/stdc++.h>
using namespace std;
int n;
const int MAX=1e6+5;
bool shibushi[MAX];
int counts[MAX];
void isprime()
{
	memset(shibushi,true,sizeof(shibushi));
	int c=0;
	counts[1]=0;
	for(int i=2;i<MAX;i++)
	{
		if(shibushi[i])
		{
			counts[i]=++c;
			for(int j=2*i;j<MAX;j+=i)
			shibushi[j]=false;
		}
		else counts[i]=c;
	}
}
int main()
{
	isprime();
	while(cin>>n)
	{
		if(n<=0) cout<<0<<endl;
		else cout<<counts[n]<<endl;
	}
	return 0;
}


