#include <iostream>
#include <cmath>
//#include <ctime>
#define Even(n) n%2
using namespace std;

void count_Prime(int n);
bool IsPrime(int num);


int main()
{
	int Data = 0;
//	clock_t start, end;
	while (cin >> Data)
	{
//		start = clock();
		count_Prime(Data);
//		end = clock();

		cout << (double)(end - start) / CLOCKS_PER_SEC << "sec" << endl;
	}

	return 0;
}

void count_Prime(int n)
{
	int counter = 0,  i = 0;
	for (i = 2; i <= n; ++i)
	{
		if (IsPrime(i))
			counter++;
	}

	cout << counter << endl;

}

bool IsPrime(int num)
{
	if (num < 2) return false;
	else if (num == 2) return true;
	else if (num % 2 == 0) return false; // ??¶??°????????????????????????

	double sqrtNum = sqrt(num);
	for (int i = 3; i <= sqrtNum; i += 2)
	{
		if (num % i == 0)
		{
			// ?´???°??§?????????
			return false;
		}
	}

	// ?´???°??§??????
	return true;
}