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

int main(){
    int n;
    int result;
    int i, j;
    bool flug = false;

    while(cin >> n){
        for(i=2; i<n; i++){
            for(j=2; j<(int)sqrt(i)+1; j++){
                if(i % j == 0){
                    flug = true;
                    break;
                }
            }
            if(!flug) result++;
            flug = false;
        }

        cout << result << endl;
        result = 0;
    }

    return 0;
}