#include<cstdio>
#include<cstring>
using namespace std;
const int MAXN=1e7;
int is_prime[MAXN],prime[10000];
int main(void){
	memset(is_prime,-1,sizeof(is_prime));
	int index=0;
	prime[0]=prime[1]=0;
	for(int i=2;i<MAXN;i++){
		if(is_prime[i])prime[index++]=i;
		for(int j=2*i;j<MAXN;j+=i)
		is_prime[j]=0;
	}
	int n;
	while(scanf("%d",&n)!=EOF){
		for(int i=0;i<index;i++)
		if(prime[i]<=n&&prime[i+1]>n)printf("%d\n",i+1);
	}
	return 0;
}