#include<stdio.h>
const int MAX_V = 10000;
int prime[MAX_V+1],sum[MAX_V+1];
int main(void){
    int i,k,n,ans;
    for(i = 0; i < MAX_V + 1; i ++){
        prime[i] = 1;
        sum[i] = 0;
    }
    prime[0] = 0;
    prime[1] = 0;
    for(i = 2; i * i < MAX_V; i ++){
        if(prime[i]){
            for(k = 2 * i; k < MAX_V; k += i){
                prime[k] = 0;
            }
        }
    }
    for(i = 2; i < MAX_V; i ++){
        sum[i+1] = sum[i] + prime[i];
    }
    while(scanf("%d",&n) != EOF){
        ans = sum[n+1];
        printf("%d\n",ans);
    }
    return 0;
}