#include <iostream>
using namespace std;

int isPrime (int n) {
    for (int i = 2; i * i <= n; i++) {
        if (n % i == 0) return 0;
    }
    return 1;
}

int main() {
    int dp[1000100] = {0};
    for (int i = 2; i <= 1000000; i++) {
        if (isPrime(i)) dp[i] = dp[i - 1] + 1;
        else dp[i] = dp[i - 1];
    }

    int n;
    while (cin >> n) cout << dp[n] << endl;
    return 0;
}
