#include<stdio.h>
#include<math.h>

int prime(int a){

int i,p;

if(a == 2) return 1;
if(a % 2 == 0) return 0;
p = sqrt(a);
for(i=3;i<=p;i+=2){
if(a%i == 0) return 0;
}
return 1;
}

int main(void){

	int a,i,sum;


	while(scanf("%d",&a) != EOF){
		sum = 0;
		for(i=1;i<=a;i++){
		sum += prime(i);
		}
		printf("%d\n",sum-1);
		}

}