#include <bits/stdc++.h>
using namespace std;
vector<pair<int, int> > v;
bool sc(pair<int, int> p) {
  bool u = 0, d = 0, l = 0, r = 0;
  for (int i = 0; i < v.size(); i++) {
    if (p.first > v[i].first && p.second == v[i].second)
      l = 1;
    else if (p.first < v[i].first && p.second == v[i].second)
      r = 1;
    if (p.second > v[i].second && p.first == v[i].first)
      d = 1;
    else if (p.second < v[i].second && p.first == v[i].first)
      u = 1;
  }
  if (u && d && l && r)
    return 1;
  else
    return 0;
}
int main() {
  int n, cnt = 0;
  pair<int, int> p;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> p.first >> p.second;
    v.push_back(p);
  }
  for (int i = 0; i < n; i++)
    if (sc(v[i]) == 1) cnt++;
  cout << cnt;
}
