#include <cstdio>
#include <cstring>
#define N 1000000
int n;
bool prime[N];
int num[N];
int main() {
    memset(prime, 1, sizeof prime);
    //for (int i=0;i<N;++i)prime[i]=true;
    prime[1] = prime[0] = num[0] = false;
    for (int i = 2; i < N; ++i)
        if (prime[i]){
            for (int j = 2 * i; j < N; j += i) prime[j] = false;
        //if (i%1000==0)
        //printf("%d %d\n",i,prime[i]);
    }
    for (int i = 1; i < N; ++i) num[i] = prime[i] + num[i-1];
    while (~scanf("%d", &n)) printf("%d\n", num[n]);
    return 0;
}

