#include <stdio.h>
#include <stdlib.h>
#include <math.h>

#define NUM_MAX		1000001

int prime(int num_max)
{
	static int numary[NUM_MAX];
	static int primeary[NUM_MAX];
	static int primeary_len = 1;
	static int num = 2;
	primeary[0] = 2;
	numary[0] = 0;
	numary[1] = 0;
	numary[2] = 1;
	if(num_max > num)
	{
		for(num++;num <= num_max;num++)
		{
			int i;
			for(i = 0;i < primeary_len;i++)
			{
				if(!(num % primeary[i]))
				{
					numary[num] = numary[num-1];
					break;
				}
				else if(num < (primeary[i] * primeary[i]))
				{
					numary[num] = numary[num-1] + 1;
					primeary[primeary_len] = num;
					primeary_len++;
					break;
				}
			}
		}
	}
	return numary[num_max];
}

int main()
{
	int n;
	while(scanf("%d",&n) != EOF)
	{
		printf("%d\n",prime(n));
	}
}