#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, x[10000], y[10000], i, j, q = 0;
  cin >> n;
  for (i = 0; i < n; i++) cin >> x[i] >> y[i];
  for (i = 0; i < n; i++) {
    bool b0 = false, l0 = false, r0 = false, t0 = false;
    for (j = 0; j < n; j++) {
      if (x[j] == x[i] && y[j] < y[i]) l0 = true;
      if (x[j] == x[i] && y[j] > y[i]) r0 = true;
      if (x[j] < x[i] && y[j] == y[i]) t0 = true;
      if (x[j] > x[i] && y[j] == y[i]) b0 = true;
    }
    if (b0 && t0 && r0 && l0) q++;
  }
  cout << q;
  return 0;
}
