import std.stdio;
import std.conv;
import std.algorithm;
import std.string;
import std.file;
import std.math;
 
int main() {
        string l;
        while((l = readln(), l.length)){
                l = l.split("\n")[0];
                int max = to!int(l);
                bool[] isPrime = [false, false];
                for(int i = 2; i <= max; i++) isPrime ~= true; // initial value
                for(int i = 2; i <= max; i++){
                        if(isPrime[i]) for(int j = i * 2; j <= max; j += i) isPrime[j] = false;
                        }               
                int cnt = 0;
                for(int i = 1; i <= max; i++) if(isPrime[i]) cnt += 1;
                printf("%d\n", cnt);
                }
        return 0;
}