#include <algorithm>
#include <cstdio>
#include <vector>

using namespace std;

bool table[1000000];
vector<int> primes;

int main() {
  table[2] = true;
  for (int i = 3; i <= 999999; i += 2)
    table[i] = true;
  for (int i = 3; i <= 1000; i += 2)
    if (table[i])
      for (int j = 3 * i; j <= 999999; j += 2 * i)
        table[j] = false;
  primes.push_back(2);
  for (int i = 3; i <= 999999; i += 2)
    if (table[i])
      primes.push_back(i);
  int n;
  while (scanf("%d", &n) == 1) {
    printf("%d\n", upper_bound(primes.begin(), primes.end(), n)-primes.begin());
  }
  return 0;
}