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