#include <stdio.h>
#include <iostream>
using namespace std;
#define MAX 1000000
#define LMT 1000
int sieve();
int calculation();
unsigned flag[MAX>>6];

int primes[5761455];
#define ifc(n) (flag[n>>6]&(1<<((n>>1)&31)))
#define isc(n) (flag[n>>6]|=(1<<((n>>1)&31)))
int main()
{
    sieve();
    return 0;
}

int sieve()
{
    unsigned i, j, k;
    for(i=3; i<LMT; i+=2)
        if(!ifc(i))
            for(j=i*i, k=i<<1; j<MAX; j+=k)
                isc(j);
    calculation();
    return 0;
}

int calculation()
{
    unsigned int i;
    int k = 1;
    primes[0] = 2;
    for( i=3; i<MAX; i+=2)
    {
        if(ifc(i)==0)
            primes[k++] = i;
    }
    int input;
    int count;
    while(scanf("%d",&input)==1)
    {
        count=0;
        for(i=0; primes[i]<=input; i++)
            count++;
        printf("%d\n",count);
    }
    return 0;
}