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

class CheckList{
public: 
    int candidateNumber;
    bool isPrime;
public:
    CheckList();
    CheckList(int number);
};

CheckList::CheckList(int number){
    candidateNumber = number;
    isPrime = true;
}

CheckList::CheckList(){
    candidateNumber = 0;
    isPrime = true;
}

int main(){
    int n;
    while(cin >> n){
        vector<CheckList> list(n-1);
        for(int i=2;i<=n;++i){
            CheckList number(i);
            list[i-2] = number;
        }
        for(int i=2;i<=sqrt(n);++i){
            if(!list[i-2].isPrime){
                continue;
            }
            for(int j=i;j<=n;++j){
                if(j%i == 0 && i != j){
                    list[j-2].isPrime = false;
                    continue;
                }
            }
        }
        for(vector<CheckList>::iterator it = list.begin();it!=list.end();){
            if(!(*it).isPrime){
                it = list.erase(it);
                continue;
            }
            it++;
        }
        cout << list.size() << endl;
    }
}