#include <iostream>
#include <cmath>
using namespace std;

int main(){
	int n;
	while ( cin >> n ){
		int cnt = 0;
		if ( n >= 2 ) ++cnt;
		for ( int i = 3; i <= n; i += 2 ){
			bool prime = true;
			for ( int j = 3; j <= sqrt( static_cast< double >( i ) ); j += 2 ){
				if ( !( i % j ) ){
					prime = false;
					break;
				}
			}
			if ( prime ) ++cnt;
		}

		cout << cnt << endl;
	}
}