#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, i, j, ans = 0;
  cin >> n;
  pair<int, int> p[n];
  int ab, be, le, ri;
  for (i = 0; i < n; i++) {
    int r, s;
    cin >> r >> s;
    p[i] = make_pair(r, s);
  }
  for (i = 0; i < n; i++) {
    ab = 0, be = 0, le = 0, ri = 0;
    for (j = 0; j < n; j++) {
      if (i == j) {
        continue;
      }
      if (p[i].first == p[j].first) {
        if (p[i].second < p[j].second) {
          ab++;
        } else {
          be++;
        }
      }
      if (p[i].second == p[j].second) {
        if (p[i].first < p[j].first) {
          ri++;
        } else {
          le++;
        }
      }
      if (ab > 0 && be > 0 && le > 0 && ri > 0) {
        ans++;
        break;
      }
    }
  }
  cout << ans;
  return 0;
}
