#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int count = 0;
  vector<pair<int, int> > v;
  for (int i = 0; i < n; i++) {
    int k, l;
    cin >> k >> l;
    v.push_back(make_pair(k, l));
  }
  for (int i = 0; i < v.size(); i++) {
    int x = v[i].first;
    int count1 = 0, count2 = 0, count3 = 0, count4 = 0;
    int y = v[i].second;
    for (int j = 0; j < v.size(); j++) {
      if (v[j].first > x && y == v[j].second) {
        ++count1;
      }
      if (v[j].first == x && y < v[j].second) {
        ++count2;
      }
      if (v[j].first < x && y == v[j].second) {
        ++count3;
      }
      if (v[j].first == x && y > v[j].second) {
        ++count4;
      }
    }
    if (count1 >= 1 && count2 >= 1 && count3 >= 1 && count4 >= 1) ++count;
  }
  cout << count;
}
