#include <bits/stdc++.h>

#define MAX 1000000
#define NIL -1

int primes[MAX];

bool isPrime(int n)
{
    if (n <= 1) {
        primes[n] = 0;
        return false;
    }
    if (n <= 3) {
        primes[n] = 1;
        return true;
    }
    if (n % 2 == 0 || n % 3 == 0) {
        primes[n] = 0;
        return false;
    }
    for (int i = 5; i * i <= n; i = i + 6)
        if (n % i == 0 || n % (i + 2) == 0) {
            primes[n] = 0;
            return false;
    }
    primes[n] = 1;
    return true;
}

int main()
{
    for (int i = 1; i <= MAX; i++) primes[i] = NIL;
    int N, sum;
    while(std::scanf("%d", &N) != EOF) {
        sum = 0;
        for (int i = 2; i <= N; i++) {
            if (primes[i] != NIL) {
                if (primes[i] == 1) sum++;
            }
            else {
                if (isPrime(i)) sum++;
            }
        }
        std::printf("%d\n", sum);
    }
    return 0;
}

