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

int main()
{
        long long max;
        vector<int> pn;
        bool npn[1000000];
        npn[0] = npn[1] = true;


        while(cin >> max){
                for(long i=2;i<max;i++){
                        if(npn[i]) continue;
                        pn.push_back(i);
                        for(long j=i*1;j<=max;j+=i)npn[j] = true;
                }

                cout << pn.size() << "\n";
                for(long i=2;i<=max;i++)npn[i] = false;
                pn.clear();
        }

        return 0;
}