#include <iostream>

using namespace std;

int MAX = 1000000;
int c[1000010];

int main() {
	int n;
	
	for (int i=0; i<=MAX; i++) c[i] = 1;
	
	for (int j=2; 2*j<=MAX; j++) c[2*j] = 0;
	
	for (int i=3; i<=MAX/2; i++) {
		if (c[i]==0) continue;
		for (int j=2; i*j<=MAX; j++) {
			c[i*j] = 0;
		}
	}
		
	while (cin>>n) {
		
		int ans = 0;
		for (int i=2; i<=n; i++) {
			ans += c[i];
		}
		cout << ans << endl;
	}
	
	return 0;
}