#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int prime(int n) {
	int k; int m[] = {2, 3, 5, 7, 11, 13,17, 19, 23, 29, 31, 37, 41};
	if(n == 2) return 1;
	if(n % 2 == 0) return 0;
for(k = 0; k < sizeof(m)/4; k++)
if(n % m[k] == 0) return 0;
	for(k = 3; k * k <= n; k += 2) {
		if(n % k == 0) return 0;
	}
	return 1;
}

int cntPrime(int n) {
	int cnt = 0, i, k;
	for(i = 2; i <= n; i++) {
		cnt += prime(i);
	}
	return cnt;
}

int main() {
	int a;
	int arg[1024] = { 0 };
	int cnt = 0;
	while(scanf("%d", &a) != EOF) {
		arg[cnt++]=a;
	}
	int i;
	for(i = 0; i < cnt; i++) {
printf("%d\n", cntPrime(arg[i]));
	}
}