#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, x, y, count = 0;
  cin >> n;
  vector<pair<int, int> > v;
  for (int i = 0; i < n; i++) {
    cin >> x >> y;
    v.push_back({x, y});
  }
  for (int i = 0; i < n; i++) {
    int rn = 0, ln = 0, lon = 0, un = 0;
    for (int j = 0; j < n; j++) {
      if (v[i].first > v[j].first && v[i].second == v[j].second) {
        rn++;
        continue;
      }
      if (v[i].first < v[j].first && v[i].second == v[j].second) {
        ln++;
        continue;
      }
      if (v[i].first == v[j].first && v[i].second < v[j].second) {
        lon++;
        continue;
      }
      if (v[i].first == v[j].first && v[i].second > v[j].second) {
        un++;
        continue;
      }
    }
    if (rn && ln && lon && un) {
      count++;
    }
  }
  cout << count;
}
