#include <iostream>
#include <iomanip>
#include <cmath>


using namespace std;
#define MAX_NUM 999999


int do_count(bool *isPrime, int n);

int main(){
  int n;
  //?´???°???true,
  bool flag = false;
  bool isPrime[MAX_NUM];


  int pivot = 2;
  
  for(int i=0;i<MAX_NUM;i++){
    isPrime[i] = false;
  }
  
  while(cin >> n){
    int cnt=0;
    //cout << n << endl;
    //    sqrt_n = sqrt(n);
    for(int i=2;i<=n;i++){
      flag = false;
      //?´???°?????????????????§??????
      for(int j=pivot;j<=sqrt(i);j++){
	if(i%j==0){
	  flag = true;
	  break;
	}
      }
      if(flag){continue;}
      isPrime[i]=true;
      //cout << "last: " << i << endl;
    }
    cnt = do_count(isPrime, n);
    //cout << "cnt: " << cnt << endl;
    cout << cnt << endl;
  }
}

int do_count(bool *isPrime, int n){
  int cnt=0;
  for(int i=0;i<=n;i++){
    if(isPrime[i]==true){
      cnt++;
    }
  }
  return cnt;
}
    
    