#include <bits/stdc++.h>
using  namespace std;
#define ll    long long int
#define pai     pair<int,int>
#define vi      vector<int>
#define vd      vector<double>
#define mpi     map<int,int>
#define mps     map<string,int>
#define sti     stack<int>
#define stc     stack<char>
#define sei     set<int>
#define ses     set<string>
#define multii  multiset<int>
#define MAX      10000010
bool prime[MAX];
void seive(){
memset(prime,true,sizeof(prime));
prime[0]=prime[1]=false;
for(int p=2;p*p<=MAX;p++){
       if(prime[p]){
    for(int i=p*p;i<=MAX;i+=p){
       prime[i]=false;
    }
}

}
}
int main(){
seive();
ll n;
int c=0;
while(cin>>n){
 for(int i=2;i<=n;i++){
   if(prime[i]){
    c++;
   }
 }
 cout<<c<<endl;
 c=0;
}

}




