#include <bits/stdc++.h>
using namespace std;
const int N = int(1e5 + 5);
struct Point {
  int x;
  int y;
};
int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  int n;
  cin >> n;
  struct Point p[N];
  int sp = 0;
  for (int i = 1; i <= n; i++) cin >> p[i].x >> p[i].y;
  for (int i = 1; i <= n; i++) {
    bool up, lp, leftp, rightp;
    up = lp = leftp = rightp = false;
    for (int j = 1; j <= n; j++) {
      if ((p[j].x > p[i].x) && (p[j].y) == p[i].y)
        rightp = true;
      else if ((p[j].x < p[i].x) && (p[j].y) == p[i].y)
        leftp = true;
      else if ((p[j].x == p[i].x) && (p[j].y) < p[i].y)
        lp = true;
      else if ((p[j].x == p[i].x) && (p[j].y) > p[i].y)
        up = true;
    }
    if (rightp && leftp && lp && up) sp++;
  }
  cout << sp << "\n";
  return 0;
}
