#include <iostream>

using namespace std;
int prime(int n){ 
        bool* notprime = new bool[n+1];
        int counter = 0;
        for(int i = 2 ; i <= n ; i++){ 
                if(!notprime[i]){
                        counter++;
                        for(int j = 2 ; j*i <= n ; j++){
                                notprime[j*i] = true;
                        }   
                }   
        }   
        return counter;
}
int main(){
        int n;
        while(cin >> n){ 
                cout << prime(n) << endl;
        }   
}