

 #include<iostream>
#include<cstring>
#include<algorithm>
#include<vector>

using namespace std;

//Nayeem Shahriar Joy ,Applied Physics And Electronic Engineering , University of Rajshahi.


int main(){

    bool prime[1000002];

    memset(prime,true,sizeof(prime));

    prime[0]=false;

    prime[1]=false;

    for(int i=2;i*i<=999999;i++)
    {
        if(prime[i]==true)
        {
            for(int j=i*2;j<=999999;j=j+i)
            {
                prime[j]=false;
            }
        }
    }

 int n;

 while(cin>>n)

 {
     int count=0;

     for(int i=0;i<=n;i++)

     {
         if(prime[i]==true)
         {
             count++;
         }
     }
     cout<<count<<endl;
 }

    return 0;
}