#include <iostream>
#include <cmath>

using namespace std;

long* primes(long high)
{
  long* p = new long[high];
  for (int i = 0; i < high; i++) {
    p[i] = 0;
  }

  long max = ceil(sqrt(high));
  for (int i = 2; i <= max; i++) {
    if (p[i - 1] == -1) continue;

    int count = 2;
    while (i * count <= high) {
      p[i * count - 1] = -1;
      count++;
    }
  }

  for (int i = 1; i < high; i++) {
    if (p[i] == -1) {
      p[i] = p[i - 1];
    } else {
      p[i] = p[i - 1] + 1;
    }
  }
  
  return p;
}

int main(int argc, char const* argv[])
{
  long* p = primes(999999);
  long n;

  while (cin >> n) {
    cout << p[n - 1] << endl;
  }
  return 0;
}