#include <stdio.h>
 
int prime[999999];
int sum[999999]={0};

void isprime(int n) {
    int i, k;
    for(i = 2; i <= n; i++) {
        prime[i] = 1;
    }
    for(i = 2; i*i <= n; i++) {
        if(prime[i]) {
            for(k = 2 * i; k <= n; k += i) {
                prime[k] = 0;
            }
        }
    }
    for(i = 0; i <= n; i++){
        sum[i+1]= sum[i] + prime[i];
    }
}
 
int main() {
    int n, i, count;
    isprime(999999);
    while(scanf("%d", &n) != EOF) {
        count = sum[n+1];
        printf("%d\n", count);
    }
    return 0;
}