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

vector<char> sieve(const int M){
    vector<char> isPrime(M);
    for(int i=2;i<M;i++) isPrime[i] = true;
    for(int i=2;i*i<M;i++){
        if(not isPrime[i]) continue;
        for(int j=i*i;j<M;j+=i){
            isPrime[j] = false;
        }
    }
    return isPrime;
}

int main (int argc, char const* argv[])
{
    int n;
    vector<char> p;
    while(cin >> n){
        int count = 0;
        p = sieve(n+1);
        for(vector<char>::iterator it = p.begin(); it != p.end() ; ++it){
            if(*it == true)
                ++count;
        }
        
        cout << count << endl;
    }
    return 0;
}