#include<iostream>
#include<algorithm>
#include<string>
#include<cstring>
#include<map>
#include<queue>
#include<cmath>
#include<stack>
#include<vector>
#include<cstdio>
#define MAXN 2555
#define INF 0x3f3f3f3f
#define v first
#define b second
using namespace std;
int vis[1000000];
int prime[10000];
int k=0;
void deal()
{
   memset(vis,0,sizeof(vis));
   for(int i=2;i*i<=999999;i++)
   {
      if(!vis[i])
      {
         prime[k++]=i;
         for(int j=i*i;j<=999999;j+=i)
         {
            vis[j]=1;
         }
      }
   }
}
int main()
{
   deal();
   int n;
   while(scanf("%d",&n)==1)
   {
      int sum=0;
      for(int i=0;i<k;i++)
      {
         if(prime[i]<=n)
            sum++;
         else break;
      }
      cout<<sum<<endl;
   }
   return 0;
}