#include <bits/stdc++.h>

using namespace std;

int main()
{
	vector<int>D(1000000 , 1);
	D[0] = 0;
	D[1] = 0;
	for(size_t i = 2; i <= sqrtl(1000000); i++)
	{
		if(D[i])
		{
			int j = 2;
			while(i*j < 1000000)
			{
				D[i*j] = 0;
				j++;
			}
		}
		D[i] += D[i - 1];
	}
	int n;
	while(cin >> n)cout << D[n] << endl;
	return 0;
}