#include<iostream>
#include<cmath>
#include<cstdio>
int main()
{
	using namespace std;
	int a[31]={0,0,1,2,2,3,3,4,4,4,4,5};
	int ans=0,t=0,n,i,j;

	while(scanf("%d",&n)!=EOF)
	{
		if(n<=11) cout<<a[n]<<endl;
		else
			for(j=12;j<=n;++j)
			{
				for(i=2;i<=(int)sqrt(n);++i)
			 		if(j%i==0) 
					{
						t=1;
						break;	
			 		}
				
				if(t==0) a[j]=a[j-1]+1;
			 		else 
					{
						t=0;
						a[j]=a[j-1];
					}	
			}
		
		if(n>11) cout<<a[n]<<endl;	
	}
	return 0;
}
