#include<bits/stdc++.h>
#define ll long long
#define pi acos(-1)
#define MAXN 1000010
#define inf 0x3f3f3f3f
using namespace std;
typedef pair<int,int>P;
bool prime[MAXN];
int cnt[MAXN];
void init()
{
	memset(prime, true, sizeof(prime));
	prime[1] = false;
	for(int i = 2; i < MAXN; i++)
	{
		if(prime[i])
		for(int j = i * 2; j < MAXN; j += i)
		prime[j] = false;
	}
	for(int i = 1; i < MAXN; i++)
	if(prime[i])
	cnt[i] = cnt[i - 1] + 1;
	else
	cnt[i] = cnt[i - 1];
}
int main()
{
	int n;
	init(); 
	while( cin >> n)
	{
		cout << cnt[n] << endl;
	}
    return 0;
}