#include <iostream>
#include <vector>

using namespace std;

int sosuu(int n) {
    vector< bool > prime(n + 1);
    prime[0] = false;
    prime[1] = false;
    for (int i = 2; i <= n; i++) {
        prime[i] = true;
    }

    for (int j = 2; j * j <= n; j++) {
        if (prime[j] == true) {
            for (int i = j; i <= n; i++) {
                if (i % j == 0 && i != j) {
                    prime[i] = false;
                }
            }
        }
    }
    int count = 0;
    for (int i = 0; i <= n; i++) {
        if (prime[i] == true) {
            // cout << i << " ";
            count++;
        }
    }
    // cout << endl;
    return count;
}

int main() {
    int a;
    while (!cin.eof()) {
        cin >> a;
        if (std::cin.fail()) break;
        cout << sosuu(a) << endl;
    }

    return 0;
}