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