#include<iostream>
#include<stdio.h>
#include<math.h>
#define INF 999999
using namespace std;

int main()
{
	int n, rootn,ans=0;
	bool a[INF] = {true};
	while (cin >> n)
	{
		rootn = sqrt(n);
		for (int i = 2; i <= rootn; i++)
		{
			for (int j = 0; j < INF; j++)
			{
				if (j%i == 0) a[j] = false;
			}
		}
		for (int i = 0; i < INF; i++)
		{
			if (a[i])++ans;
		}
		cout << ans << endl;
	}
			
	return 0;
}