#include <iostream>
#define REP(i,n) for(int (i) = 0; i <= n; ++i)
using namespace std;

bool is_prime(int n){
    for (int i = 2; i*i <= n; i++) if(n%i == 0)return false;
    return n>=2;
}

int main() {
    int n;
    while(cin>>n){
        int ret = 0;
        REP(i, n)if(is_prime(i))ret++;
        cout<<ret<<endl;
    }
    return 0;
}