#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  uint32_t n;
  cin >> n;
  vector<pair<int32_t, int32_t>> xs(2001, make_pair(9999, -9999));
  vector<pair<int32_t, int32_t>> ys(2001, make_pair(9999, -9999));
  vector<pair<int32_t, int32_t>> ns(n, make_pair(0, 0));
  for (uint32_t i = 0; i < n; i++) {
    cin >> ns[i].first >> ns[i].second;
    ns[i].first += 1000;
    ns[i].second += 1000;
    auto x = ns[i].first;
    auto y = ns[i].second;
    ys[x].first = min(ys[x].first, y);
    ys[x].second = max(ys[x].second, y);
    xs[y].first = min(xs[y].first, x);
    xs[y].second = max(xs[y].second, x);
  }
  auto cnt =
      count_if(ns.begin(), ns.end(), [&](const pair<int32_t, int32_t>& n) {
        auto x = n.first;
        auto y = n.second;
        return xs[y].first < x && x < xs[y].second && ys[x].first < y &&
               y < ys[x].second;
      });
  cout << cnt;
  return 0;
}
