#include <iostream>
#include <vector>
#include <cmath>
using namespace std;

int main()
{
   int n;
   int prime[1000000] = {1,1};
   int a=2;
   vector<int> r;
   while (scanf("%d",&n) != EOF)
   {
      int count=0;
      for (int i=a; i<=sqrt(n); i++)
      {
	 if (prime[i] == 0)
	 {
	    for (int j=i*2; j<1000000; j+=i)
	    {
	       prime[j] = 1;
	    }
	 }
	 a=i;
      }
      for (int i=2; i<=n; i++)
      {
	 if (prime[i] == 0)count++;
      }
      r.push_back(count);
   }
   for (int i=0; i<r.size(); i++)
   {
      cout << r[i] << endl;
   }
   return 0;
}