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

using namespace std;
using ll = long long;

const int MAXN = 1000000;

int tot; bool vis[MAXN];
int prime[MAXN];

void init() {
    for(int i = 2; i < MAXN; ++i) {
        if(!vis[i]) prime[tot++] = i;
        for(int j = 0; j < tot; ++j) {
            if(i*prime[j] >= MAXN) break;
            vis[i*prime[j]] = true;
            if(i%prime[j] == 0) break;
        }
    }
}

int main() {
    init();
    int n;
    while(~scanf("%d", &n)) {
        printf("%d\n", upper_bound(prime, prime+tot, n) - prime);
    }
    return 0;
}

