#include <cstdio>
#include <cmath>
using namespace std;

int main(){

int i,j,n,count;

while(scanf("%d",&n) != EOF){

count=2;

if(n<5){
	count=n-1;
}else{
	for(i=5;i<n+1;i+=2){
		for(j=2;j<(int)sqrt(i)+1;j++)

			if(i%j==0){
				break;
			}else if(j==(int)sqrt(i))
				count+=1;
	}
}

printf("%d\n",count);

}
return 0;		
}