#include <cstdio>

using namespace std;

int main() {
    long NUM = 1000000;
	long n = NUM;
	long m = 2;
	bool flag;
	long counter = 0;
	bool primeNum[NUM + 10];

	long i, len = NUM + 10;
	
	for (i = 0; i < len; i++) primeNum[i] = false;
	
    while (m <= n) {
        flag = true;
        len = m / 2;

        for(i = 2; i <= len; i++) {
            if(m % i == 0) {
                flag = false;
                
                break;
            }
        }

        if (flag) primeNum[m] = true;

        m++;
    }
    
    while (scanf("%ld", &n) != EOF) {
        counter = 0;
        
        for (i = 0; i <= n; i++) {
            if (primeNum[i]) counter++;
        }
        
        printf("%ld\n", counter);
    }

    return 0;
}