#include <bits/stdc++.h>

using namespace std;

#define all(c) (c).begin(), (c).end()
#define rep(i, n) for (int i = 0; i < (int)(n); i++)

int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};

bool isPrime[1000006];
int dp[1000006];

int main() {
    rep(i, 1000006) isPrime[i] = true;
    isPrime[0] = isPrime[1] = false;
    rep(i, 1000006) if (isPrime[i]) {
        for (int j = i * 2; j < 1000006; j += i) isPrime[j] = false;
    }
    rep(i, 1000006) if (i) {
        dp[i] = dp[i - 1];
        if (isPrime[i]) dp[i]++;
    }
    int n;
    while (cin >> n) {
        cout << dp[n] << endl;
    }
    return 0;
}