#include <cstdio>
using namespace std;

int const MAXN = 999999;

int n;
bool is_prime[MAXN+1];

void check_prime()
{
    for (int i = 0; i <= MAXN; i++) is_prime[i] = true;
    is_prime[0] = is_prime[1] = false;
    for (int i = 2; i <= MAXN; i++) {
        if (!is_prime[i]) continue;
        for (long long j = i * 2; j <= MAXN; j += i)
            is_prime[j] = false;
    }
}

int main()
{
    check_prime();
    while (scanf("%d", &n) != EOF) {
        int res = 0;
        for (int i = 0; i <= n; i++)
            if (is_prime[i]) res++;
        printf("%d\n", res);
    }
    return 0;
}