import std.algorithm;
import std.array;
import std.conv;
import std.math;
import std.stdio;
import std.string;
import std.range;

int readint() {
    return readln.chomp.to!int;
}

int[] readints() {
    return readln.split.map!(to!int).array;
}

void main() {
    const int N = 1_000_000;
    auto tab = new bool[N];
    tab[] = true;
    for (int i = 2 + 2; i < N; i += 2)
        tab[i] = false;
    for (int i = 3; i < N; i += 2) {
        if (tab[i]) {
            for (int j = i + i; j < N; j += i) {
                tab[j] = false;
            }
        }
    }

    auto sum = new int[N];
    for (int i = 2; i < N; i++) {
        sum[i] = sum[i - 1] + (tab[i] ? 1 : 0);
    }

    string s;
    while ((s = readln.chomp).length > 0) {
        int n = s.to!int;
        writeln(sum[n]);
    }
}