#include<cstdio>
#include<sstream>
#include<cstdlib>
#include<cctype>
#include<cmath>
#include<algorithm>
#include<set>
#include<queue>
#include<stack>
#include<list>
#include<iostream>
#include<fstream>
#include<numeric>
#include<string>
#include<vector>
#include<cstring>
#include<map>
#include<iterator>

using namespace std;

int prime[300000],nprime;
int mark[1000002];
int i,j;

int sieve(int n)
{
    int limit=sqrt(n*1.)+2;
    mark[1]=1;
    for(i=4;i<=n;i+=2) mark[i]=1;
    prime[nprime++]=2;
    for(i=3;i<=n;i+=2){
        if(!mark[i]){
            prime[nprime++]=i;
            if(i<=limit){
                for(j=i*i;j<=n;j+=i*2){
                    mark[j]=1;
                }
            }
        }
    }
    printf("%d\n",nprime);
    nprime=0;
}

int main()
{
    int n;
    while(scanf("%d",&n)!=EOF){
        sieve(n);
    }
    return 0;
}