#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<pair<int, int>> ar;
  while (n--) {
    int x, y;
    cin >> x >> y;
    ar.push_back(make_pair(x, y));
  }
  bool a, b, c, d;
  int count = 0;
  for (int i = 0; i < ar.size(); i++) {
    a = false, b = false, c = false, d = false;
    for (int j = 0; j < ar.size(); j++) {
      if (i != j) {
        if (ar[i].first == ar[j].first) {
          if (ar[i].second < ar[j].second) c = true;
          if (ar[i].second > ar[j].second) d = true;
        }
        if (ar[i].second == ar[j].second) {
          if (ar[i].first > ar[j].first) a = true;
          if (ar[i].first < ar[j].first) b = true;
        }
      }
    }
    if (a && b && c && d) count++;
  }
  cout << count << endl;
  return 0;
}
