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

bool check_prime(int n, vector<int>& prime_vector)
{
	if (n<=1)
		return false;
	if (n==2)
		return true;
	for (int i=0;i<prime_vector.size();i++)
		if (n%prime_vector[i]==0)
			return false;
	return true;
}

vector<int> make_prime(vector<int>& prime_vector, int n)
{
	for (int i=prime_vector[prime_vector.size()-1]+2;i<=n;i+=2)
		if (check_prime(i,prime_vector))
			prime_vector.push_back(i);

	return prime_vector;
}

int count_prime(vector<int>& prime_vector, int n)
{
	int count = 0;
	if (prime_vector[prime_vector.size()-1] >= n)
		for (int i=0;i<prime_vector.size();i++)  {
			count++;
			if (prime_vector[i] >= n) 
				break;		
		}
	else {
		make_prime(prime_vector,n);
		for (int i=0;i<prime_vector.size();i++)  {
			count++;
			if (prime_vector[i] >= n) 
				break;		
		}
	}

	return count;
}

int main()
{
	int n = 0;
	vector<int> result;
	vector<int> prime_vector;
	prime_vector.push_back(2);
	prime_vector.push_back(3);

	while(cin >> n) 
		result.push_back(count_prime(prime_vector,n));

	for(int i=0;i<result.size();i++)
		cout << result[i] << endl;
	
	return 0;
}