#include <vector>
#include <iostream>
#include <cmath>

using namespace std;

static const int MAX = 999999;

vector<bool> v(int(sqrt(MAX)), false);

using namespace std;

int main(){
    v[1] = true;
    for (size_t i = 2; i < v.size(); ++i){
        int flag = 0;
        if ((i+1) % 2 == 0) continue;
        for (size_t j = 3; j < i; ++j){
            if ((i+1)%j == 0) {flag = 1; break;}
        }
        if (flag != 1) v[i] = true;
    }
    
  
    int input;
    while (cin >> input){
     int count(0);
     for (int i = 0; i < input; ++i){count+=v[i]==true;}
     cout << count << endl;
    }
}
        