#include <bits/stdc++.h>

int main() {
  const int MAX = 1000000;
  const int SQRT = (int)std::sqrt(MAX);
  bool isPrime[MAX];
  for (int i = 0; i < MAX; i++) {
    isPrime[i] = true;
  }
  isPrime[0] = isPrime[1] = false;
  for (int i = 2; i < SQRT; i++) {
    if (isPrime[i]) {
      for (int j = i * 2; j < MAX; j += i) {
        isPrime[j] = false;
      }
    }
  }
  int n;
  while (std::cin >> n) {
    int cnt = 0;
    for (int i = 0; i <= n; i++) {
      if (isPrime[i]) cnt++;
    }
    std::cout << cnt << std::endl;
  }
}
