#include <iostream>
using namespace std;
int main(){
	int a[1000001] = {0};
	for(int i = 0; i < 1000001; i++){
		a[i] = 1;
	}
	a[0] = 0;
	a[1] = 0;
	for(int i = 0; i < 1000; i++){
		if(a[i]){
			for(int j = i * 2; j < 1000001; j += i){
				a[j] = 0;
			}
		}
	}

	int n;
	while(cin >> n){
		int k = 0;
		for(int i = 0; i <= n; i++){
			if(a[i]) k++;
		}
		cout << k << endl;
	}

	return 0;
}