#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;

int main() {
  vector<bool> p(1000000, true);
  p[0] = false;
  p[1] = false;
  for (int i = 2; i <= 1000; i++) {
    if (p[i]) {
      for (int j = i * 2; j < 1000000; j += i) {
        p[j] = false;
      }
    }
  }

  int n;
  while (cin >> n) {
    int res = 0;
    for (int j = 0; j <= n; j++)
      if (p[j]) res++;
    cout << res << endl;
  }
}

