#include "bits/stdc++.h"
using namespace std;

int main() {
  int n;
  int sum=0;
  
  vector<int>primelist(1000010);
    primelist.at(2)=1;
    primelist.at(3)=1;
  
  for(int i=3;i<1000001;i++){
    for(int j=2;j<=sqrt(i);j++){
      
      if(i%j==0){
        primelist.at(i)=0;
        break;
      }
      primelist.at(i)=1;
    }
  }
  
  while(cin >> n){
  
  sum=0;
  for(int i=0;i<(n+1);i++){
    sum=sum+primelist.at(i);
  }
  
  
  cout <<sum<<endl;
  }
  return 0;
}

