#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> x(n), y(n);
  for (int i = 0; i < n; i++) {
    cin >> x[i] >> y[i];
  }
  int c = 0;
  for (int i = 0; i < n; i++) {
    int u, d, l, r;
    u = d = l = r = 0;
    for (int j = 0; j < n; j++) {
      if (i != j) {
        if (x[i] == x[j]) {
          if (y[i] > y[j])
            d++;
          else if (y[i] < y[j])
            u++;
        } else if (y[i] == y[j]) {
          if (x[i] > x[j])
            l++;
          else if (x[i] < x[j])
            r++;
        }
      }
    }
    if (d >= 1 && u >= 1 && l >= 1 && r >= 1) c++;
  }
  cout << c;
}
