#include <iostream>

using namespace std;

#define FOR(i,a,b) for(int i = (a); i < (b); ++i)
#define REP(i,n) FOR(i,0,n)

int main(){
	int n;
	while(cin >> n){
		bool bin[1000000] = {};
		int m = 0;
		FOR(i,2,n+1)if(!bin[i]){
			REP(j,n/i+1)bin[i*j] = true;
			m++;
		}
		cout << m << endl;
	}
	return 0;
}