#include<cstdio>

using namespace std;

int is_prime(int n){
	int i;
	if(n<=1) return 0;
	if(n==2) return 1;
	if(n%2==0) return 0;

	for(i=3;i * i<=n;i+=2)
		if(n%i==0)
			return 0;
	return 1;
}

int main(void){
	int i;
	int n;
	int count;

	for(;scanf("%d",&n)==1;){

		count=0;
		for(i=2;i<=n;i++)
			if(is_prime(i)) 
				count++;

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

	return 0;
}