#include<iostream>
#include<cmath>
using namespace std;
int main()
{
	int a[999999];
	a[0] = 2;
	long long k = 1;
	for (long long i = 2; i<=999999; i++)
	{
		int flag = 1;
		for (long long j = 2; j <= sqrt(i) + 1;j++)
		{
			if (i%j == 0)
			{
				flag = 0;
				break;
			}
		}
		if (flag)
			a[k] = i, k ++ ;
	}
	int n;
	while (cin >> n)
	{
		long long ans = 0;
		for (long long x = 0; x < k; x++)
		{
			if (n >= a[x])
				ans++;
			else
				break;
		}
		cout << ans << endl;
	}
	return 0;
}
