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