#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <math.h>

using namespace std; 

long int a,b,loop,hasil;
long int lo;
long int hi;

bool Prima(unsigned long n) 
{
    if (n % 2 == 0 || n % 3 == 0)
	{
        return false;
    }
 
    for (unsigned short i = 5; i * i <= n; i += 6) 
	{
        if (n % i == 0 || n % (i + 2) == 0) 
		{
            return false;
        }
    }
 
    return true;
}

int main()
{
	while(scanf("%ld",&hi)!= EOF)
	{
	lo=2;
	hasil=1;
		while(lo<=hi)
		{
			if(lo==2||lo==3||lo==5)
			{
				hasil++;
				lo=lo+1; 
			}
			if(lo==4)
			{
				lo++;
			}
			else 
			{
				if(Prima(lo))
				{
					hasil++;
				}
				lo++;
			}
		}
	printf("%d\n",hasil);
	}
	return 0; 
}