#include<stdio.h>
 
int main(){
	int a, count = 1, i, j, k = 0;
	while(scanf("%d", &a) != EOF){
		if(a = 1){
			printf("0\n");
			continue;
		}
		for(i = 3; i <= a; i += 2){
			for(j = 3; j < i; j += 2){
				if(i % j == 0){
					k = 1;
					break;
				}
			}
			if(k == 0) count++;
			k = 0;
		}
		printf("%d\n", count);
		count = 1;
	}
	return 0;
}