import std.stdio;
import std.c.stdio;
import std.range;
import std.array;
import std.functional;
import std.algorithm;
import std.conv;
import std.container;
import std.math;
import std.numeric;
import std.string;
import std.c.string;
import std.regex;
import std.typecons;

int[] sosuton()
{
	const nMax = 1000000;
	auto sosulist = new bool[];
	sosulist[] = true;
	sosulist[0] = sosulist[1] = false;
	int[] sosu;
	foreach(int i; 0 .. nMax)
	{
		if(sosulist[i])
		{
			sosu ~= i;
			for(int j = 2 * i; i < nMax; j += i)
				sosulist[j] = false;
		}
	}
	return sosu;
}

void main()
{
	int n = stdin.readln.chomp.to!int;
	if(n <= 2)
		writeln(0);
	else
	{
		int[] countsosu[] = sosuton();
		for(int i = 0; i < countsosu.length; ++i)
		{
			if(countsosu[i] > n)
			{
				writeln(i);
				break;
			}
		}
	}
}