#include <iostream>
using namespace std;

int prime[1000000] = {1};

int main()
{
  int n;
  prime[0] = prime[1] = 0;
  for (int i = 2; i < 1000000; i++){
    if (prime[i] == 1){
      for (int j = 2 * i; i < 1000000; j += i){
        prime[j] = 0;
      }
    }
  }
  for (int i = 0; i < 1000000; i++){
    prime[i + i] += prime[i];
  }
  while (cin >> n){
    cout << prime[n];
  }

  return 0;
}