#include <iostream>

using namespace std;

int n;
bool is_prime[1000000];

int solve()
{
    int result = 0;
    for (int i = 0; i <= n; ++i)
    {
        is_prime[i] = true;
    }

    for (int i = 2; i <= n; ++i)
    {
        if (!is_prime[i])
        {
            continue;
        }
        ++result;
        for (int j = i * 2; j <= n; j += i)
        {
            is_prime[j] = false;
        }
    }
    return result;
}

int main()
{
    while (cin >> n)
    {
        cout << solve() << endl;
    }
    return 0;
}