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

using namespace std;
int N = 999999;
int prime[999999];
int status[999999/32];

bool Check(int N, int pos)
{
	return (bool)(N&(1<<pos));
}
int Set(int N, int pos)
{
	return N = N | (1<<pos);
}
void sieve()
{
	int i, j, sqrtN;
	sqrtN = sqrt(N);

	for(i=3; i<=sqrtN; i+=2)
	{
		if(Check(status[i/32], i%32) == 0)
		{
			for(j=i*i; j<=N; j+=(2*i))
				status[j/32] = Set(status[j/32], j%32);
		}
	}
	int k = 1;
	prime[0] = 2;
	for(int i=3; i<=N; i+=2)
	{
		if(Check(status[i/32], i%32) == 0)
			prime[k++] = i;
	}
}
int main()
{
	sieve();
	int k, num, count = 0;
	k=0;
    while(scanf("%d", &num)!=EOF)
    {
        k=0;
    	count = 0;

        for(int i=1; i<=num; i++)
        {
            if(i == prime[k])
                {
                    count++;
                    k++;
                }
        }
        printf("%d\n", count);
    }
	return 0;
}