#include <iostream>
#include <math.h>

using namespace std;

int main() {
  int N = 1000001;
  int primes[N];
  int i, j;
  for (i = 2; i < N; i++) {
    primes[i] = 1;
  }

  for (i = 2; i <= int(sqrt(N)); i++) {
    if (primes[i]) {
      for (j = i*i; j < N; j+=i) {
        primes[j] = 0;
      }
    }
  }

  int n;
  while (cin >> n) {
    int ans = 0;
    for (i = 2; i <= n; i++) {
      ans += primes[i];
    }
    cout << ans << endl;
  }

  return 0;
}