#include"iostream"
#include"math.h"
#define ll long long 
using namespace std;
int snt(ll n)
{
 ll i;
 ll m;
 if(n == 2 || n == 3)
  return 1;
 if (n == 1||n % 2 == 0||n % 3 == 0)
  return 0;
 m = (int)sqrt(n);
 for(i=5;i<=m;i=i+6)
  if(n % i == 0 || n % (i+2) == 0) return 0;
 return 1;
}
ll lam(ll n)
{
	ll d=0;
	for(ll i=2;i<=n;i++)
	{
		if(snt(i))
		d++;
	}
	return d;
}
int main()
{
	ll n;
	do
	{
		cin>>n;
		cout<<lam(n);
		cout<<endl;
	}while(1);
}