#include <bits/stdc++.h>
using namespace std;
const int n = 1e7;
int cnt, prime[n + 1], vis[n + 1], r[n + 1];

int main() {
    for (int i = 2; i <= n; i++) {
        if (!vis[i]) prime[++cnt] = i;
        for (int j = 1; j <= cnt && (long long)i * prime[j] <= n; j++) {
            vis[i * prime[j]] = 1;
            if (i % prime[j] == 0) break;
        }
    }
    for (int i = 2; i <= n; i++) {
        if (!vis[i])
            r[i] = r[i - 1] + 1;
        else
            r[i] = r[i - 1];
    }
    int a;
    while (cin >> a) cout << r[a] << "\n";
}
