#include <iostream>
#include <cmath>

using namespace std;

int main()
{
    int n;
    bool prime[1000000];

    prime[0] = false;
    for (int i = 1; i < 1000000; i++) 
        prime[i] = true;

    for (int i = 1; i < (int)sqrt(1000000); i++) {
        if (prime[i] == true)
            for (int j = i + 1; (i + 1) * j <= 1000000; j++)
                prime[(i + 1) * j - 1] = false;
    }


    while (cin >> n) {
        int cnt = 0;

        for (int i = 0; i < n; i++)
            if (prime[i] == true)
                cnt++;
        cout << cnt << endl;
    }
    
    return 0;
}