#include <bits/stdc++.h>
using namespace std;

#define rep(i, n) REP(i, 0, n)
#define ALL(v) v.begin(), v.end()
#define MSG(a) cout << #a << " " << a << endl;
#define REP(i, x, n) for (int i = x; i < n; i++)
#define OP(m) cout << m << endl;
typedef long long ll;
typedef unsigned long long ull;

int main()
{
    int n;
    while (cin >> n)
    {
        int count = 0, p[n + 1] = {};
        for (int i = 2; i <= (int)sqrt(n); i++)
        {
            if (p[i] == 0)
            {
                for (int j = 2; i * j <= n; j++)
                {
                    p[i * j] = 1;
                }
            }
        }
        for (int i = 2; i <= n; i++)
        {
            if (p[i] == 0)
            {
                count++;
            }
        }
        OP(count)
    }

    return 0;
}
