#include <bits/stdc++.h>
using namespace std;
struct Vec2 {
  int x, y;
  bool left, right, top, bottom;
  Vec2() : x(0), y(0), left(false), right(false), top(false), bottom(false) {}
};
int main() {
  int n;
  Vec2 points[200];
  int ans = 0;
  cin >> n;
  for (int i = 0; i < n; ++i) cin >> points[i].x >> points[i].y;
  for (int i = 0; i < n; ++i)
    for (int j = 0; j < n; ++j) {
      if (points[i].x > points[j].x && points[i].y == points[j].y)
        points[j].right = true;
      if (points[i].x < points[j].x && points[i].y == points[j].y)
        points[j].left = true;
      if (points[i].y < points[j].y && points[i].x == points[j].x)
        points[j].bottom = true;
      if (points[i].y > points[j].y && points[i].x == points[j].x)
        points[j].top = true;
    }
  for (int i = 0; i < n; ++i)
    if (points[i].left && points[i].right && points[i].top && points[i].bottom)
      ans += 1;
  cout << ans;
  return 0;
}
