#include <iostream>
#include <vector>

using namespace std;

int prime(int n) {
  int i, j, r;
  
  if (n < 2) return 0;
  vector<int> primes(n);

  for (i = 2; i < n; i++)
    primes[i] = i;
  for (i = 2; i*i < n; i++) {
    if (primes[i])
      for (j = i*i; j < n; j += i)
        primes[j] = 0;
  }
  for (i = 2, r = 0; i < n; i++)
    if (primes[i]) r++;
  return r;
}

int main() {
  int n;
  while(cin >> n)
    cout << prime(n) << endl;
  return 0;
}