#include <iostream>
#include <algorithm>
#include <cmath>
using namespace std;
const int N = 1e6+5;
int is_prime[N];

int prime(int n)
{
	for(int i = 0;i <= n;++i)	
		is_prime[i] = true;
	is_prime[0] = 1;is_prime[1] = false;
	int res = 0;
	for(int i = 2;i <= n;++ i)
	{
		if(is_prime[i])
		{
			++res;
			for(int j = i * 2;j <= n;j += i)
				is_prime[j] = false;
		}
	}
	return res;
}

int main()
{
	int n;
	while(cin >> n)	
		cout << prime(n) << endl;
	return 0;
}
