#include <iostream>
#include <cstdio>
#include <string>
#include <cstring>
#include <cmath>
#include <algorithm>
#include <vector>
#include <queue>
using namespace std;
#define MAX 1000000
#define LMT 1000
unsigned flag[MAX>>6];
int primes[6000000];//5761455
#define ifc(n) (flag[n>>6]&(1<<((n>>1)&31)))
#define isc(n) (flag[n>>6]|=(1<<((n>>1)&31)))

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);
    return 0;
}

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