#include <iostream>
#include <cmath>
#include <vector>
using namespace std;

typedef unsigned long long ull;

ull qtde[1000000] = { 0, 0, 1, 2 };

bool isPrime(ull x) {
  ull i = 6;
  ull root = (ull)sqrt(x) + 2;
	if (x <= 1)
		return false;
  if (x == 2 || x == 3)
    return true;
  if (x % 2 == 0 || x % 3 == 0)
    return false;

  while (i <= root) {
    if (x % (i - 1) == 0)
      return false;
    if (x % (i + 1) == 0)
      return false;
    i += 6;
  }

  return true;
}

int main(int argc, char const *argv[]) {
    ull n;
    ull i;
    
    for (int i = 3; i < 1000000; i++)
      qtde[i] = qtde[i-1] + isPrime(i);

    while (cin >> n)
      cout << qtde[n] << endl;

    return 0;
}

