#include <math.h>
#include <algorithm>
#include <string>
#include <iostream>
using namespace std;

#define MAX 10000000
int a[MAX];

int main()
{
	int n;
	a[0] = a[1] = 0;
	a[2] = 1;
	a[3] = 2;
	for (int i = 4; i < MAX; i++)
	{
		bool ok = true;
		for (int j = 2; j < sqrt(i) + 0.1; j++)
		{
			if (i % j == 0)
			{
				a[i] = a[i - 1];
				ok = false;
				break;
			}
		}
		if (ok)
			a[i] = a[i - 1] + 1;
	}

	while (cin >> n)
		cout << a[n] << endl;
	
	return 0;
}