#include<iostream>
#include<math.h>
using namespace std;

int main()
{
	int number=0;
	int result=0;
	while(1)
	{
		result=1;
		cin>>number;
		if(number==1||number==0)
			result=0;
		else
		{

			for(int i=number;i>2;i--)
				if(i%2!=0)
				{
					int f=0;
					for(int j=2;j<=sqrt(i);j++)
						if(i%j==0)
						{
							f=1;	
							break;
						}
					if(f==0)
						result++;
				}
		}
		cout<<result<<endl;
	}
	return 0;
}