#include<iostream>
#include<iomanip>
#include<cmath>
#include<string>
#include<vector>
#include<list>
#include<algorithm>
#include<map>
#include<set>
#include<queue>
#include<stack>
using namespace std;
typedef long long ll;
#define fi first
#define se second
#define mp make_pair
#define rep(i, n) for(int i=0;i<n;++i)
#define rrep(i, n) for(int i=n;i>=0;--i)
const int inf=1e9+7;
const ll mod=1e9+7;
const ll big=1e18;
const double PI=2*asin(1);


int main() {
  bool prime[1000005];
  int primenum[1000005];
  for(int i=0;i<1000005;++i) prime[i] = true;
  prime[0] = false;
  prime[1] = false;
  for(int i=2;i<1000005;++i){
    if(prime[i]==false) continue;
    for(int j=2;i*j<1000005;++j){
      prime[i*j] = false;
    }
  }
  primenum[0] = 0;
  primenum[1] = 0;
  for(int i=2;i<1000005;++i){
    if(prime[i]){
      primenum[i] = primenum[i-1] + 1;
    }
    else{
      primenum[i] = primenum[i-1];
    }
  }
  int N;
  while(cin>>N){
    cout<<primenum[N]<<endl;
  }
}

