#include <iostream>
#include <bitset>

using namespace std;

int main() {
  bitset<1000000> prime;
  int i, j, n;
  while (cin >> n) {
    prime.reset();
    for (i = 2; i <= n; i++)
      if (prime[i] == false)
	for (j = i + i; j <= n; j += i)
	  prime[j] = true;
    cout << n - prime.count() - 1 << endl;
  }
}