#include <iostream>
#include <math.h>
using namespace std;

int x[1000000];

int solve(int b){
    int m = 0;
    if(b == 1){
        return 0;
    }else if(b==2){
        return 1;
    }
    x[m++] = 2;
    for(int i=3;i<=b;i+=2){
        bool a = true;
        for(int j=0;j<m;j++){
            if(i%x[j]==0){
                a = false;
                break;
            }
        }
        if(a){
            x[m++] = i;
        }
    }
    return m;
}

int main(){
    int n;
    while((cin>>n)){
        cout << solve(n) << endl;
    }
    return 0;
}