#include <iostream>
#include <vector>

#define rep(i, n) for(int i = 2; i <= n; i ++)

using namespace std;

int main(void){
	for(int n, count = 0; cin >> n; cout << count << endl, count = 0){
		vector<bool> numberList(n + 1);

		rep(i, n) numberList[i] = true;

		rep(i, n) for(int j = i; i * j <= n; j ++) numberList[i * j] = !(numberList[i * j]);
		
		rep(i, n) if(numberList[i]) count ++;
	}

	return 0;
}