#include <iostream>
#include <vector>
using namespace std;
int main() {
  const long N = 1000000;
  vector<bool> primes(N, true);
  primes[0] = primes[1] = false;
  for (int i = 2; i * i < N; i++) {
    if (!primes[i]) continue;
    for (int j = i * i; j < N; j += i)
      primes[j] = false;
  }
  vector<long> answer(N);
  answer[0] = 0;
  for (long i = 1; i < N; i++)
    answer[i] = answer[i - 1] + primes[i];
  long n;
  while (cin >> n)
    cout << answer[n] << endl;
}