#include <iostream>
#include <bitset>
#include <cmath>
using namespace std;

int main()
{
	int count=0,n;

	while(cin>>n)
	{
		int prime[1000001]={0};
		prime[0]=1;
		prime[1]=1;
		for(int i=2;i<=sqrt(n);i++)
			if(prime[i]==0)
				for(int j=i+1;j<=n;j++)
					if(i%j==0)
						prime[j]=1;
		for(int i=2;i<=n;i++)
			if(prime[i]==0)
				count++;
		cout<<count<<endl;
		count=0;
	}
}