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

int primes[1000000]={0};


int main(){
    primes[0] = -1;
    primes[1] = -1;
    for(int i=2; i<1000; i++){
        if(primes[i]==-1) continue;
        for(int j=i+1; j<1000000; j++){
            if(j%i==0) primes[j] = -1;
        }
    }
    int n;
    while(-1!=scanf("%d", &n)){
        int ans = 0;
        for(int i=2; i<=n; i++){
            if(primes[i] == 0) ans++;
        }
        cout << ans << endl;
    }
}