#include <algorithm>
#include <cstdio>
#include <cstring>

using namespace std;
int N;
int primes[1000000];

void prime() {
    fill(primes, primes + 1000000, 1);
    for (int i = 2; i <= 999999; i++) {
        if (primes[i]) {
            for (int j = i + i; j <= 999999; j += i)
                primes[j] = 0;
        }
    }
}

int main() {
    prime();
    while (~scanf("%d", &N)) {
        int ans = 0;
        for (int i = 2; i <= N; ++i)
            ans += primes[i];
        printf("%d\n", ans);
    }
    return 0;
}