#include <iostream>
using namespace std;

int main() {

  bool sosu[1000000] = {false};
  for ( int i = 2; i < 1000000; i++ ) {

    if ( sosu[i] == false ) {
      for ( int j = i*2; j < 1000000; j+=i ) {
	sosu[j] = true;
      }
    }

  }

  int n;
  while( cin >> n ) {

    int cnt = 0;
    for ( int i = 2; i <= n; i++ ) {
      if ( sosu[i] == false ) cnt++;
    }

    cout << cnt << endl;

  }

  return 0;

}