#include <cstdio>
#include <bitset>

using namespace std;

int main()
{
  int n;
  bitset<1000000> is_prime;
  is_prime.set();
  is_prime[0] = false, is_prime[1] = false;
  for (int i = 2; i * i< 1000000; i++) {
    for (int j = i * 2; j < 1000000; j += i) {
      is_prime[j] = false;
    }
  }
  while (scanf(" %d ", &n) == 1) {
    int c = 0;
    for (int i = 0; i <= n; i++) {
      if (is_prime[i]) {c++;}
    }
    printf("%d\n", c);
  }
  return 0;
}