#include <iostream>
#include <sstream>
#include <vector>
#include <algorithm>
#include <string>
#include <functional>
#include <numeric>
#include <ctype.h>
#include <cstdlib>
#include <string.h>
#include <cmath>
#include <cstdio>





using namespace std;

bool isPrime(int num);

int main()
{
	int input, count = 0;

	while (cin >> input)
	{
		count = 0;

		for (int i = 2; i <= input; i++)
		{
			if (isPrime(i))
			
				count++;
	
		}
		cout << count << 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;
}