#include <iostream>
#include <vector>
#include <algorithm>
#define N 500000
using namespace std;

int main(){

  int n;
  int a,b,i;
  int sosu[N];
  bool judge;

  sosu[0] = 2;
  for(a=3,i=1;a<1000000;a++){
    judge = true;
    for(b=0;sosu[b]*sosu[b] <= a;b++){
      if(a%sosu[b] == 0){
	judge = false;
	break;
      }
    }
    if(judge){
      sosu[i] = a;
      i++;
    }
  }
  sosu[i] = 1000000;
  while(cin >> n){
    if(0<n && n<1000000){
      for(i=0;sosu[i]<=n;i++);
      cout << i << endl;
    }
  }

  return 0;
}