#include<iostream>
using namespace std;
#define N 1000000
int main(){
	bool prime[N+1] = {0};
	prime[1] = 1;
	for(int i = 2; i * i <= N; i++){
		if(prime[i] == 0){
			for(int j = i; j <= N; j+=i){
				prime[j] = 1;
			}
			prime[i] = 0;
		}
	}
	int n;
	while(cin >> n){
		int cnt = 0;
		for(int i = 1; i <= n; i++){
			if(!prime[i])cnt++;
		}
		cout << cnt << endl;
	}
	return 0;
}