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

int main(){
	int  n,i,j,sqrtn,sum;
	while(scanf("%d",&n)!=EOF){
		sum=n-1;
		for(i=2;i<=n;i++){
			sqrtn=(int)sqrt(i);
			for(j=2;j<sqrtn;j++){
				if(i%j==0){
					sum--;
					break;
				}
			}
		}
		printf("%d\n",sum);
		
	}
	return 0;
}