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


