#include <iostream>
#include <algorithm>
#include <deque>
using namespace std;


int main()
{

	int i,n,count,num;
	deque<int> sosu;
	deque<int>::iterator it;
	bool flg;
	
	while(cin >> n){
		sosu.clear();
		if( n <= 2 ) {
			if( n == 2 ) {
				count = 1;
			}
			else 
				count = 0;
		}
		else {
			for( i = 3; i <= n ; i+=2 ) {
				flg = true;	
				for(it = sosu.begin(); it != sosu.end(); it++ ) {
					num = *it;
					if( i < 2 * num ){
						break;
					}
					if( (i % num ) == 0 ){
						flg = false;
						break;
					}				
				}
				if( flg == true ) {
					sosu.push_back( i );
				}
			}
			count = sosu.size() + 1;
		}
		cout << count << endl;
	}
			
	return 0;
}