#include <iostream>
#include <cmath>

using namespace std;
int main()
{
    bool a[1000000];
    for (int i = 0; i < 1000000; i++) {
        a[i] = true;
    }
    for (int i = 2; i <= sqrt(1000000); i++) {
        if (a[i]){
            for (int j = i; i*j < 1000000; j++) {
                a[i*j] = false;
            }
        }
    }
    
    
    int n;
    while (cin >> n) {
        int cnt = 0;
        for (int i = 2; i <= n; i++) {
            if (a[i]){
                cnt++;
            }
        }
        cout << cnt << endl;
    }
    return 0;
}