#include <iostream>
#include <cmath>
 
bool CheckPrimeNumber(int number) {
    int max = (int)std::sqrt(number);
    for (int i=3; i<=max; i+=2)
        if (number % i == 0)
            return false;
    return true;
}
 
int main() {
    int n, cnt;
    while (std::cin >> n) {
        if (n < 2) {
	cnt = 0;
        } else if (n == 2) {
	cnt = 1;
        } else {
        	cnt = 1;
        	for (int i=3; i<=n; i+=2)
		if (CheckPrimeNumber(i))
			cnt++;
        }
        std::cout << cnt << std::endl;
    }
    return 0;
}
