#include <iostream>
#include <vector>

using namespace std;

int main(void){
	int num = 0;
	vector<int> vec;
	while (cin >> num){
		int count = 0;
		bool hantei = true;
		for (int i=2; i<num; ++i){
			for (int j=2; j<i; ++j){
				if ((i%j) == 0){
					hantei = false;
					break;
				}
			}
			if (hantei == true){
				++count;
			}
		}
		vec.push_back(count);
	}
	vector<int>::iterator it = vec.begin();
	while(it != vec.end()){
		cout << *it << endl;
		++it;
	}
	return 0;
}