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

#define MAX (1000000)

int main(void)
{
	char prime[MAX + 1];
	int n;
	char buf[256];
	
	memset(prime, 1, sizeof(prime));
	
	prime[0] = prime[1] = 0;
	for (int i = 2; i * i < MAX; i++){
		if (prime[i] == 1){
			for (int j = i * 2; j <= MAX; j += i){
				prime[j] = 0;
			}
		}
	}
	
	while (fgets(buf, 256, stdin) != NULL){
		int ans;
		
		n = atoi(buf);
		
		ans = 0;
		for (int i = 2; i <= n; i++){
			ans += prime[i];
		}
		
		printf("%d\n", ans);
	}
	
	return (0);
}