#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, x, y;
  vector<pair<int, int> > points;
  cin >> n;
  int neighbors[n][4], z = 0, total = 0;
  while (n--) {
    cin >> x >> y;
    points.push_back(pair<int, int>(x, y));
    neighbors[z][0] = 0;
    neighbors[z][1] = 0;
    neighbors[z][2] = 0;
    neighbors[z][3] = 0;
    z++;
  }
  for (int i = 0; i < points.size(); i++) {
    for (int j = i + 1; j < points.size(); j++) {
      if (points[i].first == points[j].first) {
        if (points[i].second > points[j].second) {
          neighbors[i][0]++;
          neighbors[j][2]++;
        } else {
          neighbors[i][2]++;
          neighbors[j][0]++;
        }
      }
      if (points[i].second == points[j].second) {
        if (points[i].first > points[j].first) {
          neighbors[i][1]++;
          neighbors[j][3]++;
        } else {
          neighbors[i][3]++;
          neighbors[j][1]++;
        }
      }
    }
  }
  for (int i = 0; i < z; i++) {
    total += neighbors[i][0] && neighbors[i][1] && neighbors[i][2] &&
             neighbors[i][3];
  }
  cout << total << "\n";
  return 0;
}
