#include <iostream>
#include <cstdio>
using namespace std;


#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define repback(i,n) for(int i=(int)n-1;i>=0;i--)
#define repa(i,a,n) for(int i=a;i<(int)(n);i++)
typedef pair<int, int> P;
typedef long long ll;
const ll INF = 1e7, MAX_N = 1000000, MAX_M = 1000, MAX_W = 20, MAX_H = 20;
int asc(const void* a, const void* b) {
    return *(int*)a - *(int*)b;
}

int is_prime[MAX_N]; //i番目の素数
bool prime[MAX_N]; //iが素数であるかどうか

int seive(int n) {
    rep(i, n+1) prime[i] = true;
    prime[0] = prime[1] = false;
    int p = 0;
    repa(i,2,n+1) {
        if (prime[i]) {
            is_prime[p++] = i;
            for (int j = i * 2; j <= n; j += i) prime[j] = false;
        }
    }
    return p;
}
int main() {
    int n;
    while (cin >> n) {
        int ans = seive(n);
        cout << ans << endl;
    }

    return 0;
}
