#include <iostream>
using namespace std;

int num(int n)
{
    int a[1000000] = {1, 1};
    for (int i = 2; i <= n; ++i)
        for (int j = 2; i * j <= n; ++j)
            a[i * j] = 1;
    int cnt = 0;
    for (int i = 0; i <= n; ++i)
        if (a[i] == 0)
            ++cnt;
    return cnt;
}

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

