#include <iostream>
#include <cmath>

int prime(int number) {
    int s_num = sqrt(number);
    if (number == 2) {
        return 1; 
    } else if (number % 2 == 0) {
        return 0;
    }
    for (int i = 3; i <= s_num; i += 2) {
        if (number % i == 0) {
            return 0;
        }
    }
    return 1;
}

int main(void) {
    int number;
    int count;

    while (std::cin >> number) {
        count = 0;
        for (int i = 2; i <= number; i++) {
            if (prime(i) == 1) {
                count++;
            }
        }
        std::cout << count << std::endl;

    }
    return 0;
}