#include <iostream>
using namespace std;

int main(){
  bool prime[1000000];
  int np[1000000], n;

  for(int i=2; i<1000000; i++){
    if(!prime[i]){
      for(int j=2; j*i<1000000; j++){
	prime[i*j] = true;
      }
    }
    np[i] = np[i-1] + !prime[i];
  }

  while(cin >> n)
    cout << np[n] << endl;

  return 0;
}