#include <stdio.h>
#include <math.h>

int is_prime (int N)
{
    if (N<2) return 0;

    int limit = (int) sqrt(N);
    for (int i=2; i<=limit; ++i)
    {
        if (N%i==0)
            return 0;
    }

    return 1;
}

int main ()
{
    int num, primes, t=0;

    while ((scanf("%d", &num) != EOF) && (t<=30))
    {
        ++t;
        primes = 0;

        for (int i=1; i<=num; ++i)
        {
            if (is_prime(i)) ++primes;
        }

        printf("%d\n", primes);
    }

    return 0;
}