#include <stdio.h>

int sieve(int n)
{
	char prime[999999];
	int i, j;
	int p;
	
	for (i = 0; i <= n + 1; i++){
		prime[i] = 1;
	}
	prime[0] = prime[1] = 0;
	
	for (i = 2; i <= n + 1; i++){
		if (prime[i]){
			for (j = 2 * i; j <= n; j += i){
				prime[j] = 0;
			}
		}
	}
	for (i = 0, p = 0;i <= n; i++){
		if (prime[i] == 1){
			p++;
		}
	}
	
	return (p);
}

int main(void)
{
	int num;
	int ans;
	
	while (scanf("%d", &num) != EOF){
		ans = sieve(num);
		
		printf("%d\n", ans);
	}
	
	return (0);
}