#include <iostream>
#include <iomanip>

using namespace std;


int main(int argc, const char * argv[]) {
    // insert code here...
    
    int maxNumber;
    int countPrime=0;
    
    int prime[999999]={0};
    
    prime[0]=-1;
    prime[1]=-1;
    

        for(int i=2; i<1000000;i++){
            for(int j=2; j<i;j++){
                if(i%j==0){
                    prime[i]=-1;
                }
            }
        }
    
    

    while(cin >> maxNumber){
        countPrime=0;
        for(int x=2;x<maxNumber+1;x++){
            if(prime[x]==0){countPrime++;}
        }
        cout << countPrime << endl;
    }


    return 0;
}
