#include <iostream>
#include <cstdio>
#include <cstdlib>

using namespace std ;

int n, cnt[1000008]; 
bool prime[1000008];

int main() {
	prime[1] = true;
	for (int i = 2; i <= 999999; i ++) prime[i] = false;
	for (int i = 2; i <= 999999; i ++) {
		if (!prime[i]) {
			for (int j = 2*i; j <= 999999; j += i) {
				prime[j] = true;
			}
		}
	}
	cnt[1] = 0;
	for (int i = 2; i <= 999999; i ++) {
		cnt[i] = cnt[i - 1] + (int)(!prime[i]);
	}
	while (cin >> n) {
		cout << cnt[n] << endl ;
	}
	return 0 ;
}
