#include<iostream>
#include<cmath>
using namespace std;
int main()
{
	int n,sum,i,k,sqrtm;
	while(cin>>n)
	{
		sum=3;
		if(n<2){cout<<0<<endl;continue;}
		if(n==2){cout<<1<<endl;continue;}
		if(n==3){cout<<2<<endl;continue;}
		if(n==5 || n==4){cout<<3<<endl;continue;}
		 i=6;
	 while(i<n)
		{
			i++;
			if(i%2==0)continue;
			if(i%3==0)continue;
			if(i%5==0)continue;
			sqrtm=sqrt(i);
			for(k=2;k<=sqrtm+1;k++)
			{if(i%k==0)break;}
			if(k==sqrtm+2)sum++;
		}
		cout<<sum<<endl;
	}
}