#include <iostream>
using namespace std;

int main()
{
	const int N = 1000000;
	static bool P[N];
	for ( int i=2; i<N; i++)
		P[i]=true;
	for(int i=2; i*i<N; i++ )
	if(P[i])
		for(int j=i+i;j<N;j+=i)
			P[j]=false;

	int n;
	while(cin>>n)
	{
		int c=0;
		for ( int i=0; i<=n; i++ )
			if (P[i])
				c++;
		cout<< c<<endl;
	}
	return 0;

}