#include <iostream>
#include <cstdio>
#include <vector>

using namespace std;
vector<int> prime;

int calc(int);

int main(){
    int n;
    prime.push_back(2);
    while(-1!=scanf("%d", &n)){
        cout << calc(n) << endl;
    }
    return 0;
}

int calc(int n){
    int lastPrime = prime[prime.size()-1];
    if(n > lastPrime){
        for(int i=lastPrime; i<=n; i++){
            bool isPrime = true;
            for(int j=0; j<prime.size(); j++){
                int checkPrime = prime[j];
                if(i%checkPrime==0){
                    isPrime = false;
                    continue;
                }
            }
            if(isPrime) prime.push_back(i);
        }
        return prime.size();
    }else{
        for(int i=0; i<prime.size(); i++){
            if(prime[i]>=n){
                return i;
            }
        }
    }
    return -1;
}