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