#include <bits/stdc++.h>
using namespace std;
class coord {
 public:
  int x, y;
  int r = 0, l = 0, u = 0, d = 0;
};
int main() {
  int n;
  cin >> n;
  vector<coord> v;
  while (n--) {
    int x, y;
    cin >> x >> y;
    coord c;
    c.x = x;
    c.y = y;
    v.push_back(c);
  }
  int count = 0;
  for (int i = 0; i < v.size(); i++) {
    for (int j = 0; j < v.size(); j++) {
      int x1 = v[i].x, x2 = v[j].x;
      int y1 = v[i].y, y2 = v[j].y;
      if ((x1 > x2) and (y1 == y2)) {
        v[i].r = 1;
      }
      if ((x1 < x2) and (y1 == y2)) {
        v[i].l = 1;
      }
      if ((y1 > y2) and (x1 == x2)) {
        v[i].u = 1;
      }
      if ((y1 < y2) and (x1 == x2)) {
        v[i].d = 1;
      }
      if (v[i].u + v[i].d + v[i].l + v[i].r == 4) {
        count++;
        break;
      }
    }
  }
  cout << count << endl;
  return 0;
}
