#include <iostream>
#include <cmath>

bool eratosthenes(int n);

int main()
{
    std::ios::sync_with_stdio(false);
    std::cin.tie(0);

    int n;
    while (std::cin >> n) {
        int cnt = 0;
        for (int i = 2; i <= n; ++i)
            if (eratosthenes(i))
                ++cnt;
        std::cout << cnt << std::endl;
    }
}

bool eratosthenes(int n)
{
    if (n == 2) return true;
    if (n < 2 || n % 2 == 0) return false;
    int i = 3;
    double root_n = std::sqrt((double) n);
    while (i <= root_n) {
        if (n % i == 0) return false;
        i += 2;
    }
    return true;
}


