#include <bits/stdc++.h>
using namespace std;

vector<int> eratosthenes(int n) {
  vector<int> res, p(n + 1, 1);
  p[0] = p[1] = 0;
  for (int i = 2; i * i <= n; ++i) {
    if (p[i]) {
      for (int j = 2 * i; j <= n; j += i) {
        p[j] = 0;
      }
    }
  }
  for (int i = 0; i <= n; ++i) {
    if (p[i]) res.push_back(i);
  }
  return res;
}

int main() {
  int n;
  while (cin >> n) cout << eratosthenes(n).size() << endl;
}