#include<stdio.h>

int main(){
	
	static int prime[999999 + 1];
	
	int i, j, k = 0, limit;
	
	for(i = 2; i < 1000000; i++){
		prime[i] = 1;
	}
	
	prime[0] = prime[1] = 0;
	
	for (i = 2; i < 1000000; i++){
		if(prime[i]){
			for (j = i + i; i < 1000000; j += i){
				prime[j] = 0;
			}
		}
	}
	while(scanf("%d", &limit) != EOF){
		for(i = 2; i <= limit; i++){
		
			if(prime[i]){
				k++;
			}
		}
	
		printf("%d\n", k);
	
	}
	return 0;
	
}