#include <bits/stdc++.h>
using namespace std;

#define int				long long
#define FOR( i, m, n )  for( int (i) = (m); (i) < (n); (i)++ )
#define FORE( i, m, n ) FOR( i, m , n + 1 )
#define REP( i, n )     FOR( i, 0, n )
#define REPE( i, n )	FOR( i, 0, n + 1 )
#define REPR( i, m )	for( int (i) = (m); (i) >= 0; (i)-- )
#define REPONE( i, n )	FOR( i, 1, n + 1 )
#define ALL( a )        (a).begin(), (a).end()             
#define MP( a, b )		make_pair( (a), (b) )
#define fi				first
#define se				second

template<class T>bool chmax( T& a, const T& b ) { if( a < b ) { a = b; return 1; } return 0; }
template<class T>bool chmin( T& a, const T& b ) { if( a > b ) { a = b; return 1; } return 0; }

const int INF = 1e9;
const int MOD = 1e9 + 7;

int prime[1000000] = {};

signed main() {
	int n;
	fill( prime, prime + 1000000, 1 );

	FOR( i, 2, 1000000 ) {
		if( prime[i] ) {
			for( int j = i * i; j < 1000000; j += i ) {
				prime[j] = 0;
			}
		}
	}

	while( cin >> n ) {
		int cnt = 0;
		FORE( i, 2, n ) {
			if( prime[i] ) cnt++;
		}
		cout << cnt << endl;
	}
}
