#include<bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for (int i=(a);i<(b);i++)
#define RFOR(i,a,b) for (int i=(b)-1;i>=(a);i--)
#define REP(i,n) for (int i=0;i<(n);i++)
#define RREP(i,n) for (int i=(n)-1;i>=0;i--)
bool prime[1000001];

typedef long long LL;
int main(){
        REP(i,1000001){
            prime[i]=true;
        }
        prime[0]=false;
        prime[1]=false;
        REP(i,1000001){
            if(prime[i]==false)continue;
            for(int j=2*i;j<1000001;j+=i){
                prime[j]=false;
            }
        }
        LL a;
        while(cin>>a){
           LL c=0;
           REP(i,a+1){
               if(prime[i]==true){
                  c++;
               }
           }
           cout<<c<<endl;
        }
	return(0);
}