#include <stdio.h>

int isPrime(int x);

int main(){
    int max;
    int count;
    
    while (scanf("%d", &max) != EOF){
        count = 0;
        for (int i=2; i<=max; i++){
            if (isPrime(i)) count++;
        }
        printf("%d\n", count);
    }
}

int isPrime(int x){
    for (int i=2; i*i<=x; i++){
        if (x%i == 0) return 0; 
    }
    return 1;
}