#include<iostream>

#define bound 1000000

int main()
{
  bool is_prime[bound] = {};
  for (int i = 2; i < bound; i++)
    is_prime[i] = true;
  for (int prime = 2; prime < bound; ++prime)
    {
      if (!is_prime[prime]) continue;
      for (int i = prime * 2; i < bound; i += prime)
	is_prime[i] = false;
    }

  int table[bound] = {};
  for (int i = 0; i < bound; ++i)
      table[i] = table[i - 1] + is_prime[i];

  int n;
  while(std::cin >> n)
      std::cout << table[n] << std::endl;

  return 0;
}

