#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;

int main(){

  int n;
  int a,b,i;
  bool count[1000000];
  count[2] = true;
  for(a=3;a<1000000;a++){
    i = 0;
    if(a%2!=0){
      for(b=3,i=1;b<=a/3;b++){
	if(b%2!=0){
	  if(a%b == 0){
	    i = 0;
	    break;
	  }
	}
      }
    }
    if(i)
      count[a] = true;
    else
      count[a] = false;
  }

  while(cin >> n){
    for(a=2,b=0;a<n;a++)
      if(count[a] == true)
	b++;
    cout << b << endl;
  }
  return 0;
}