#include<iostream>

using namespace std;

int n;

int main()
{
	while(cin>>n)
	{
		int count = 0;
		bool *flag = new bool[n]();
		for(int i=2;i<=n;++i)
		{
			if (flag[i]==true)
			{
				continue;
			}
			for(int j=i*2; j<n; j+= i)
			{
				flag[j] = true;
			}
		}

		for(int i=2;i<n;i++)
		{
			if(flag[i]==false)
			{
				++count;
			}
		}
		cout<<count<<endl;
	}
}