#include <iostream>
#include <vector>
using namespace std;
int main()
{
    vector<int> primes;
    primes.push_back(2);
    int Testcase,Counter;
    while(cin >> Testcase)
    {

        Counter = 0;
        if(Testcase >= 2)
        {
            Counter++;
        }
        for(int i=3; i <= Testcase; i+=2)
        {
            bool prime=true;
            for(int j=0;j<primes.size() && primes[j]*primes[j] <= i;j++)
            {
                if(i % primes[j] == 0)
                {
                    prime=false;
                    break;
                }
            }
            if(prime)
            {
                primes.push_back(i);
                Counter++;
            }

        }
        cout << Counter << endl;
    }

}