#include <iostream>
#include <cstring>
#include <cmath>

using namespace std;


int main()
{
    unsigned int n;
    while( cin >> n )
    {
        bool *prime = new bool[n+2];
        unsigned int k, allprime = 0;

        memset( prime, false, n+2 );
        prime[2] = true;
        for( int i = 3; i <= n; i++ )
        {
            if( i % 2 == 0 )
            {
                prime[i] = false;
            }
            else
            {
                prime[i] = true;
            }
        }
        k = sqrt( n );
        for( int i = 3; i <= k; i++ )
        {
            for( int j = i + i; j <= n; j += i )
            {
                prime[j] = false;
            }
        }
        for( int i = 2; i <= n; i++ )
        {
            if( prime[i] )
            {
                allprime++;
            }
        }
        cout << allprime << '\n';
    }
    return 0;
}