#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, i;
  vector<pair<int, int> > v;
  cin >> n;
  int x, y;
  for (i = 0; i < n; i++) {
    cin >> x >> y;
    v.push_back(make_pair(x, y));
  }
  int j, snum = 0;
  for (i = 0; i < n; i++) {
    int left = 0, right = 0, up = 0, down = 0;
    for (j = 0; j < n; j++) {
      if (v[i].first == v[j].first && v[i].second > v[j].second)
        down++;
      else if (v[i].first == v[j].first && v[i].second < v[j].second)
        up++;
      else if (v[i].first > v[j].first && v[i].second == v[j].second)
        right++;
      else if (v[i].first < v[j].first && v[i].second == v[j].second)
        left++;
      if (right > 0 && left > 0 && up > 0 && down > 0) {
        if (left + right + up + down >= 4) {
          ++snum;
          break;
        }
      }
    }
  }
  cout << snum << endl;
}
