#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cassert>
#include <algorithm>
#include <iostream>
#include <utility>
#include <set>
#include <map>
#include <vector>
#include <queue>
#define LL long long
#define PII pair<int, int>
using namespace std;
const int MAXN = 1000000;

int sum[MAXN+5];

int main() {
    ios_base::sync_with_stdio(0); cin.tie(0);
    // freopen("in.txt", "r", stdin);
    // freopen("out.txt", "w", stdout);
    sum[1] = 0;
    for (int i = 2; i <= MAXN; i++) {
        if (sum[i] == 0) {
            for (int j = i + i; j <= MAXN; j += i) {
                sum[j] = 1;
            }
        }
        sum[i] = sum[i - 1] + !sum[i];
    }

    int N;
    while (cin >> N) {
        cout << sum[N] << "\n";
    }
}

