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

using namespace std;

#define MAX 10000000
#define LMT 3163
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()
{
    int Rang, count;
    unsigned int i;
    int k = 1;
    primes[0] = 2;
    for( i=3; i<MAX; i+=2)
    {
        if(ifc(i)==0)
            primes[k++] = i;
    }
    while(scanf("%d",&Rang)==1)
    {
        count = 0;
        for(i=0; i<Rang; i++)
        {
            if(primes[i]<=Rang)
            {
                count++;
            }
            else if(primes[i]>Rang)
                break;
        }
        cout << count << "\n";
    }
    return 0;
}