import std.stdio;

void main() {
    int n;
    readf(" %s", &n);

    if (n < 105) {
        writeln(0);
        return;
    }
    if (n == 105) {
        writeln(1);
        return;
    }

    auto ans = 1;
    for (auto i = 107; i <= n; i++ ) {
        if (i % 2 == 0)
            continue;
        auto cnt = 1;
        for (auto j = 3; j <= n; j++ )
            if (i % j == 0)
                cnt++;
        if (cnt == 8)
            ans++;
    }
    ans.writeln;
}