#include <stdio.h>

char num[1000050];

void check(void)
{
	int i, j;
	
	num[0] = 1;
	num[1] = 1;
	num[2] = 0;
	
	for (i = 2; i < 1000000; i++){
		if (num[i] == 0){
			j = 2;
			while (i * j < 1000000){
				num[i * j] = 1;
				j++;
			}
		}
	}
}
		
int main()
{
	int i, n, sum;
	
	check();
	
	while (scanf("%d", &n) != EOF){
		
		sum = 0;
		
		for (i = 0; i <= n; i++){
			
			if (num[i] == 0)
			sum++;
		}
		
		printf("%d\n", sum);
	}
	
	return (0);
}
		