#include <iostream>
using namespace std;
#define MAX 1000000

int main()
{
    int prime[MAX-1], S[MAX-1];
    for (int i = 0; i < MAX; i++)
    {
        prime[i] = 1;
    }
    prime[0] = prime[1] = 0;
    for (int i = 2; i < MAX; i++)
    {
        if (prime[i] != 0)
        {
            for (int j = 2 * i; j < MAX; j += i)
            {
                prime[j] = 0;
            } } }
        
        
    for (int i = 1; i < MAX; i++)
    {
        S[i] = prime[i] + S[i - 1];
    }
    S[0] = prime[0];
    int N;
    while (cin >> N)
    {
        cout << S[N] << endl;
    }
    return 0;
}

