#include <cstdio>

const int size = 1000005;
int n;
bool ispm[size];

int get(int n) {
	int ans = 0;
	for ( int i = 1; i <= n; i ++ ) ispm[i] = 1;
	for ( int i = 2; i <= n; i ++ ) {
		if(ispm[i]) {
			ans ++;
			for ( int j = 2*i; j <= n; j += i) ispm[j] = 0;
		}
	}

	return ans;
}

int main() {
	while( scanf("%d", &n) != EOF ) {
		printf("%d\n", get(n));
	}

	return 0;
}