#include<iostream>
#include<string>
using namespace std;
const int MAX_N=10000000;
bool data[10000000];
int sum[10000000];
void solve()
{
	for (int i = 2; 2 * i < MAX_N;i++)
	if (data[i])
	for (int j = 2 * i; j < MAX_N; j = j + i)
		data[j] = false;

	data[0] = data[1] = false;

	for (int i = 0; i < MAX_N; i++)
		sum[i + 1] = sum[i] + data[i + 1];
}

int main()
{
	memset(data, true, sizeof(data));
	int n = 0;
	solve();
	while (cin >> n){
		cout << sum[n] << endl;
	}
}