#include <stdio.h>
int prime[999999];
int main()
{
    long long n,i,j,k,cou;

    prime[0]=prime[1]=1;
    for(i=2;i*i<=999999;i++)
    {

        if(prime[i]==0)
    {
        for(j=i+i;j<999999;j+=i)
        {
            prime[j]=1;
        }
    }
    }
    while(scanf("%lld",&n)==1)
    {
        cou=0;
        for(k=1;k<=n;k++)
        {
            if(prime[k]==0)
                cou++;
        }
        printf("%lld\n",cou);
    }

    return 0;

}