#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<pair<int, int> > v(n);
  for (int i = 0; i < n; i++) {
    int x, y;
    cin >> x >> y;
    v[i] = (make_pair(x, y));
  }
  int ans = 0;
  for (int i = 0; i < n; i++) {
    int lc = 0, rc = 0, uc = 0, dc = 0;
    for (int j = 0; j < n; j++) {
      if (j != i) {
        if (v[j].second > v[i].second and v[j].first == v[i].first) uc++;
        if (v[j].second < v[i].second and v[j].first == v[i].first) dc++;
        if (v[j].second == v[i].second and v[j].first > v[i].first) rc++;
        if (v[j].second == v[i].second and v[j].first < v[i].first) lc++;
      }
    }
    if (lc >= 1 and dc >= 1 and rc >= 1 and uc >= 1) ans++;
  }
  cout << ans;
}
