#include<iostream>
#define nINF -2147483648
using namespace std;
int p10(int x)
{
	int t=1;
	for (int i=1;i<=x;i++) t*=10;
	return t; 
}

bool a[1000000];
int s[1000000];
int main()
{
	int k,t=0;
	for (int i=2;i<=p10(3);i++)
	{
		k=2;
		while (i*k<p10(6))
		{
			a[k*i]=true;
			k++;
		}
	}
	for (int i=2;i<=p10(6);i++)
	{
		if (!a[i]) t++;
		s[i]=t;
	}
	while (cin>>k) cout<<s[k]<<endl;
	return 0;
}