#include<iostream>
#include<vector>
#include<cmath>
#include<algorithm>

int main()
{
	int n;

	while(std::cin >> n)
	{
		int checkLimit = sqrt((double)n);

		std::vector<bool> Prime(n+1,true);

		Prime[0] = false;

		Prime[1] =false;
		
		for(int i=2; i<checkLimit+1; ++i)
		{
			if(!(Prime[i]))
			{
				continue;
			}

			for(int j=2*i; j<n+1; j+=i)
			{
				Prime[j] = false; 
			}

		}

		std::cout << std::count(Prime.begin(),Prime.end(),true) << '\n';
	}
}