#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int n;
  cin >> n;
  vector<pair<int, int> > v;
  long long int x, y;
  for (int i = 0; i < n; i++) {
    cin >> x >> y;
    v.push_back(make_pair(x, y));
  }
  int ans = 0;
  for (int i = 0; i < n; i++) {
    int a = 0, b = 0, c = 0, d = 0;
    for (int j = 0; j < n; j++) {
      if (i != j) {
        if (v[j].first > v[i].first && v[j].second == v[i].second) {
          a = 1;
        }
        if (v[j].first < v[i].first && v[j].second == v[i].second) {
          b = 1;
        }
        if (v[j].first == v[i].first && v[j].second < v[i].second) {
          c = 1;
        }
        if (v[j].first == v[i].first && v[j].second > v[i].second) {
          d = 1;
        }
      }
    }
    if (a && b && c && d) {
      ans++;
    }
  }
  cout << ans << endl;
  return 0;
}
