#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int x[n], y[n];
  int res;
  for (int i = 0; i < n; i++) {
    cin >> x[i] >> y[i];
  }
  for (int i = 0; i < n; i++) {
    bool p = false;
    bool q = false;
    bool r = false;
    bool s = false;
    for (int j = 0; j < n; j++) {
      if (x[i] < x[j] && y[i] == y[j])
        p = true;
      else if (x[i] > x[j] && y[i] == y[j])
        q = true;
      if (y[i] < y[j] && x[i] == x[j])
        r = true;
      else if (y[i] > y[j] && x[i] == x[j])
        s = true;
    }
    if ((p == true) && (q == true) && (r == true) && (s == true)) res++;
  }
  cout << res << endl;
  return 0;
}
