#include <bits/stdc++.h>
#include <vector>
using namespace std;
bool flag[10000000];
int n, hasil;
int main(){

	for(int i = 1; i <= 1000000; i++){
		flag[i] = true;
	}
	for(int i = 2; i <= 1000; i++){
		if(flag[i] == true){
			for(int u = i*i; u <= 1000000; u = u + i){
				flag[u] = false;
			}
		}
	}
	flag[1] = false;
	while(cin >> n){
		hasil = 0;
		for(int i = 1; i <= n; i++){
			if(flag[i])
				hasil++;
		}
		cout << hasil << endl;
	}
	return 0;
}