#include<stdio.h>
 
#define MAX 1000000
 
int main(){
    char prime[MAX];
    int num, i, j, ans;
 
    for(i = 0; i < MAX; i++)
    {
        prime[i] = 1;
    }
    prime[0] = prime[1] = 0;
    for(i = 2; i < (MAX/2); i++)
    {
        if(prime[i])
        {
            for(j = 2*i; j < MAX; j += i)
            {
                prime[j] = 0;
            }
        }
    }
     
    while(scanf("%d", &num) != EOF)
    {
        ans = 0;
         
        for(i = 3; i <= num; i+=2)
        {
            ans += prime[i];
        }
         
        printf("%d\n", ans);
    }
 
    return 0;
}