#include<cstdio>
#include<vector>
#include<iostream>

using namespace std;

vector<bool> prime(1000010, 1);

signed main(){
    prime[0] = 0; prime[1] = 0; prime[2] = ( const ) 1;
    int ret = 0;
    int n; scanf( "%d", &n );
    for( int i = 2; i * i <= n; i++ ){
        if( prime[i] ){
            for( int j = 1; ( j + 1 ) * i <= n; j++ ){
                prime[i * ( j + 1 )] = 0;
            }
        }
    }
    for( int i = 0; i <= n; i++ )
    {
        if( prime[i] )
        {
            ret++;
        }
    }
    printf( "%d\n", ret );
    return 0;
}
