#include <bits/stdc++.h>
using namespace std;
struct point {
  int x, y;
};
int main() {
  vector<point> vec;
  int n, answer = 0;
  cin >> n;
  vec.resize(n);
  for (int i = 0; i < n; ++i) cin >> vec[i].x >> vec[i].y;
  for (int i = 0; i < n; ++i) {
    int a = 0, b = 0, c = 0, d = 0;
    for (int j = 0; j < n; ++j) {
      if (vec[i].x > vec[j].x && vec[i].y == vec[j].y)
        ++a;
      else if (vec[i].x < vec[j].x && vec[i].y == vec[j].y)
        ++b;
      else if (vec[i].x == vec[j].x && vec[i].y > vec[j].y)
        ++c;
      else if (vec[i].x == vec[j].x && vec[i].y < vec[j].y)
        ++d;
    }
    if (a && b && c && d) ++answer;
  }
  cout << answer << endl;
  return 0;
}
