#include <iostream>
#include <vector>
#include <cstring>

using namespace std;

int main(int argc, char *argv[]) {
  int n;
  const int max = 1000000;
  vector<int> result;
  bool nums[max];
  for (int i = 2; i < max; i++)
    nums[i] = true;
  for (int i = 2; i < max; i++) {
    if (!nums[i])
      continue;
    else if (i * i > max)
      break;
    for (int j = i+1; j < max; j++) {
      if (!nums[j])
        continue;
      else if (j % i == 0)
        nums[j] = false;
    }
  }

  while (cin >> n) {
    int piyo = 0;
    for (int i = 2; i <= n; i++)
      if (nums[i])
        piyo++;
    result.push_back(piyo);
  }

  for (int i = 0; i < result.size(); i++)
    cout << result[i] << endl;
  return 0;
}