#pragma GCC optimize(2)
#pragma GCC optimize(3)
#include<bits/stdc++.h>
#define fo(x,a,b) for(register int x=a;x<=b;x++)
#define dfo(x,a,b) for(register int x=a;x>b;x--)
using namespace std;
int n,a[1000000];
bool ans[1000000];
int main ()
{	
	fo(i,2,999999)
	{
		ans[i]=true;
		fo(j,2,sqrt(i))
		{
			if (i%j==0) {ans[i]=false;break;}
		}
		
	}
	do
	{
		scanf("%d",&n);
		if (getchar()!='\n') break;
		int te=0;
		if (a[n]==0)
		{
			fo(i,2,n)
			{
				if (ans[i]) te++;
			}
			a[n]=te;
		}
		printf("%d\n",a[n]);
	} while (true);
	
	return 0;
}


