#include <bits/stdc++.h>

using namespace std;

const int kSieveSize = 1000001;
bool sieve[kSieveSize] = {true, true};

int main()
{
  vector<int> primes;
  primes.reserve(kSieveSize);
  for (int i = 2; i * i < kSieveSize; ++i){
    if (sieve[i]) continue;
    primes.push_back(i);
    for (int j = i * i; j < kSieveSize; j += i){
      sieve[j] = true;
    }
  }
  for (int n; ~scanf("%d", &n); ){
    printf("%d\n", upper_bound(primes.begin(), primes.end(), n) - primes.begin());
  }

  return (0);
}