#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  int n;
  cin >> n;
  vector<pair<int, int>> a(n);
  for (auto &i : a) cin >> i.first >> i.second;
  int cnt = 0;
  for (int i = 0; i < n; ++i) {
    int u = 1, b = 1, r = 1, l = 1;
    for (int j = 0; j < n; ++j) {
      if (j == i) continue;
      if (a[i].first == a[j].first && a[i].second < a[j].second) {
        u = 0;
      } else if (a[i].first == a[j].first && a[i].second > a[j].second) {
        b = 0;
      } else if (a[i].first > a[j].first && a[i].second == a[j].second) {
        l = 0;
      } else if (a[i].first < a[j].first && a[i].second == a[j].second) {
        r = 0;
      }
      if (!u && !b && !r && !l) {
        ++cnt;
        break;
      }
    }
  }
  cout << cnt << endl;
  return 0;
}
