import std.stdio;
import std.math;
import std.conv;
import std.string;

void main() {
    const int MAX = 1000000;
    int[MAX] p;
    p[2] = 1;
    for (int i = 3; i < MAX; i++) {
        if (i % 2 == 0) {
            p[i] = p[i-1];
        } else if (isPrime(i)) {
            p[i] = p[i-1] + 1;
        } else {
            p[i] = p[i-1];
        }
    }

    foreach (string line; stdin.lines) {
        int n = line.chomp.to!int;
        p[n].writeln;
    }
}

bool isPrime(double e) {
    bool res = true;
    for (int i = 3; i <= sqrt(e); i += 2) {
        if (e % i == 0) {
            res = false;
            break;
        }
    }
    return res;
}