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

int main()
{
	int counter=1,n,flag;
	
	while(cin>>n)
	{
		if(n<=1) 
		{
			cout<<'0'<<endl;
			break;
		}

		for(int i=3;i<=n;i+=2)
		{
			flag=1;
			for(int j=3;j<=sqrt(i);j+=2)
				if(i%j==0)
				{
					flag=0;
					break;
				}
			if(flag==1)
				counter++;
		}
		cout<<counter<<endl;
		counter=1;
	}
}