#include<stdio.h>
int main()
{
    long long n;
    while(scanf("%lld",&n)==1)
    {
       long long i,j,k,s=0;
       for(i=2;i<=n;i++)
    {

        k=0;
        if(i%2==0&&i!=2)
            k=1;
      for(j=3;j*j<=i&&k==0;j+=2)
      {
          if(i%j==0)
          {
              k=1;
              break;
          }
      }
       if(k==0)
          {
             ++s;
          }
    }
        printf("%lld\n",s);
    }
}