#include <bits/stdc++.h>
using namespace std;
int main() {
  bool p[1000000 + 1];
  int n, ans;
  for (int i = 0; i <= 1000000; i++) {
    p[i] = (i <= 1) ? false : true;
  }
  for (int i = 2; i <= sqrt(1000000) + 1; i++) {
    if (p[i]) {
      for (int j = i * 2; j <= 1000000; j += i) {
        p[j] = false;
      }
    }
  }
  while (cin >> n) {
    ans = 0;
    for (int i = 0; i <= n; i++) {
      if (p[i]) {
        ans++;
      }
    }
    cout << ans << endl;
  }
}
