#include <iostream>
#include <cmath>

using namespace std;

long long int num[100000100];

void erat(int n) {
    for (int i = 0; i <= n; i++) num[i] = true;

    num[0] = num[1] = false;

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

int main()
{
    int n, cnt = 0;

    while (cin >> n) {
        erat(n);
        for (int i = 0; i <= n; i++) {
            if (num[i]) cnt++;
        }
        cout << cnt << endl;
        cnt = 0;
    }
}

