#include<iostream>
using namespace std;
bool arr[1000000];
int main()
{
	int n,p;
	cin>>n;
  	for(int i=2;i<=1000000;i++){
		if(arr[i]==0)
		{
		    p=i;
			for (int j=2;p*j<=1000000;j++)
			{
				arr[p*j]=1;
			}
		}
	}
	int count=0;
	for(int i=2;i<=n;i++){if(arr[i]==0)count++;}
	cout<<count<<endl;
	delete[] arr;
	return 0;
}