#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<pair<int, int>> v;
  for (int i = 0; i < n; i++) {
    int l, m;
    cin >> l >> m;
    v.push_back(make_pair(l, m));
  }
  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 (v[i].first > v[j].first and v[i].second == v[j].second) a++;
      if (v[i].first < v[j].first and v[i].second == v[j].second) b++;
      if (v[i].first == v[j].first and v[i].second < v[j].second) c++;
      if (v[i].first == v[j].first and v[i].second > v[j].second) d++;
    }
    if ((a >= 1 and b >= 1) and (c >= 1 and d >= 1)) ans += 1;
  }
  cout << ans << endl;
  return 0;
}
