#include <bits/stdc++.h>
using namespace std;
int points;
vector<pair<int, int> > crds;
int central;
void solve() {
  for (int i = 0; i < points; ++i) {
    pair<int, int> tmp = crds[i];
    bool up, down, left, right;
    up = down = left = right = false;
    for (int j = 0; j < points; ++j) {
      pair<int, int> pnt = crds[j];
      if (tmp.first == pnt.first && tmp.second > pnt.second) up = true;
      if (tmp.first == pnt.first && tmp.second < pnt.second) down = true;
      if (tmp.first < pnt.first && tmp.second == pnt.second) left = true;
      if (tmp.first > pnt.first && tmp.second == pnt.second) right = true;
    }
    if (up && down && left && right) ++central;
  }
}
int main() {
  cin >> points;
  crds.resize(points);
  for (int i = 0; i < points; ++i) {
    pair<int, int> tmp;
    cin >> tmp.first >> tmp.second;
    crds[i] = tmp;
  }
  solve();
  cout << central;
  return 0;
}
