#include <iostream>
using namespace std;


int main()
{
	int n;
	
	while(cin >> n)
	{
		if (n>999999) continue;
		int i, j;
		int k = 0;
		for (i = 2; i <= n; i++)
		{
			int c = 0;
			for(j = 1; j<=i /2; j++)
			{
				if(i % j == 0)
				{
					c++;
					if (c > 1) break;
				}
			}
			if (c == 1)
			{
				k++;
			}
		}
		cout << k << endl;
	}
}