#include <iostream>
using namespace std;

bool prime(int num) {
    if (num < 2) return false;
    else if (num == 2) return true;
    else if (num % 2 == 0) return false;

    for (int i = 3; i * i <= num; i += 2) {
        if (num % i == 0) return false;
    }

    return true;
}

int main() {
    int ans[1000000], n;
    ans[0] = 0;
    for (int i = 1; i <= 999999; ++i) {
        if (prime(i)) ans[i] = ans[i - 1] + 1;
        else ans[i] = ans[i - 1];
    }

    while (cin >> n) {
        cout << ans[n] << endl;
    }
    
    return 0;
}
