#include <bits/stdc++.h>
using namespace std;

const int N = 1e6L + 11;
int p[N];
int sum[N];

int main() {
	iota(p, p + N, 0);
	for(int i = 2; i < N; i ++) if(p[i] == i)
		for(int j = i; j < N; j += i) p[j] = i;
	for(int i = 2; i < N; i ++)
		sum[i] = sum[i - 1] + (p[i] == i);
	ios :: sync_with_stdio(false);
	int n;
	while(cin >> n)
		cout << sum[n] << '\n';
	return 0;
}