#include<cstdio>
#include<cmath>

bool isPrime(int n){
    if(n==2)
        return true;
    else if(!(n&1))
        return false;
    else if(n == 3 || n == 5 || n == 7)
        return true;
    else if(n%3 == 0 || n%5 == 0)
        return false;
    else{
        int root=sqrt(n);
        for(int i=7; i<=root; i+=2)
            if(n%i==0)
                return false;
    }
    return true;
}

int PrimeCounter(int n){
    int counter=0;
    for(int i=2; i<=n; i++){
        if(isPrime(i)){
            counter++;
        }
    }
    return counter;
}

int main()
{
    int n;
    while(scanf("%d", &n) != EOF){
        printf("%d\n", PrimeCounter(n));
    }
    return 0;
}