#include <iostream>
#include <cmath>

using namespace std;

    int g(int n){
        int p = 0;
        bool is_prime[n + 1];
        is_prime[0] = is_prime[1] = false;

        for(int i = 2 ; i <= n ; i++)
            is_prime[i] = true;

        for(int i = 2 ; i <= n ; i++){
            if(is_prime[i]){
                p++;
                for(int j = i * 2 ; j <= n ; j += i) // j = i * 2 like 2 started form 4 then add 2 each time j += i not j * 2
                    is_prime[j] = false;
            }
        }
    return p;
}

int main(){
    int n;

    while(cin >> n){
        cout << g(n) << endl;
    }

}
