#include <stdio.h>
int prime[1000000];
int main()
{
    int n, i, j, count;

    for(i=2; i*i<=9999; i++)
    {
        for(j=i*i;j<=999999; j=j+i) prime[j]=1;
    }
    while(scanf("%d", &n)==1)
    {
        count=0;
        for(i=2; i<=n; i++)
        {
            if(prime[i]==0)
            {
                //printf("%d\n", i);
                count++;
            }
        }
        printf("%d\n",count);
    }
    return 0;
}