#include <iostream>

#define rep(i,n)      for(int i=0;i<n;i++)

using namespace std;

static const int LIM = 1000000;
bool np[LIM / 2];

bool is_prime(int n)
{
	return n == 2 || (n % 2 == 1 && !np[n/2]);
}

int main()
{
	np[0] = true;
	for (int i = 3; i * i < LIM; i += 2)
		if (!np[i/2])
			for (int j = 3 * i; j < LIM; j += 2 * i) np[j/2] = true;

	int N;
	while (cin>>N)
	{
		int c = 0;
		rep(i,N+1)
			if (is_prime(i)) c++;
		cout << c << endl;
	}
	return 0;
}