#include <cstdio>
#include <vector>

const int MAX_N = 999999;
std::vector<bool> primes(MAX_N, true);

void sieve() {
  primes[0] = false;
  primes[1] = false;
  for (int i = 2; i < primes.size(); ++i) {
    if (!primes[i]) { continue; }
    for (int j = 2, m = i * j; m < primes.size(); m = i * ++j) {
      primes[m] = false;
    }
  }
}

int main() {
  sieve();

  int n;
  while (true) {
    if (scanf("%d", &n) != 1) { break; }
    int count = 0;
    for (int i = 0; i <= n; ++i) { if (primes[i]) { ++count; } }
    printf("%d\n", count);
  }

  return 0;
}