#include <bits/stdc++.h>
using namespace std;
struct sosed {
  bool l;
  bool r;
  bool d;
  bool u;
};
int main() {
  long long n;
  cin >> n;
  vector<int> a(2 * n);
  vector<pair<int, sosed>> x, y;
  for (int i = 0; i < 2 * n; ++i) {
    cin >> a[i];
    sosed t;
    t.l = t.r = t.d = t.u = 0;
    if (i % 2 == 0)
      x.push_back(make_pair(a[i], t));
    else
      y.push_back(make_pair(a[i], t));
  }
  for (int i = 0; i < n; ++i) {
    for (int j = i + 1; j < n; ++j) {
      if (x[i].first == x[j].first) {
        if (y[i].first > y[j].first) {
          x[i].second.d = 1;
          x[j].second.u = 1;
        } else {
          x[j].second.d = 1;
          x[i].second.u = 1;
        }
      }
      if (y[i].first == y[j].first) {
        if (x[i].first > x[j].first) {
          x[i].second.l = 1;
          x[j].second.r = 1;
        } else {
          x[j].second.l = 1;
          x[i].second.r = 1;
        }
      }
    }
  }
  int res = 0;
  for (int i = 0; i < n; ++i) {
    if (x[i].second.l && x[i].second.r && x[i].second.d && x[i].second.u) res++;
  }
  cout << res;
}
