#include <bits/stdc++.h>
using namespace std;
bool comp(pair<int, int> &a, pair<int, int> &b) {
  if (a.first == b.first) return a.second < b.second;
  return a.first < b.first;
}
int main() {
  int n, i, j, x, y, c = 0;
  cin >> n;
  vector<pair<int, int> > a;
  for (i = 0; i < n; ++i) {
    cin >> x >> y;
    a.emplace_back(make_pair(x, y));
  }
  sort(a.begin(), a.end(), comp);
  for (i = 2; i < n - 2; ++i) {
    int u = 0, d = 0, l = 0, r = 0;
    for (j = i - 1; j >= 0; --j) {
      if (a[j].first < a[i].first && a[j].second == a[i].second) {
        l = 1;
        break;
      }
    }
    if (l == 0) continue;
    for (j = i - 1; j >= 0; --j) {
      if (a[j].second < a[i].second && a[j].first == a[i].first) {
        u = 1;
        break;
      }
    }
    if (u == 0) continue;
    for (j = i + 1; j < n; ++j) {
      if (a[j].first > a[i].first && a[j].second == a[i].second) {
        r = 1;
        break;
      }
    }
    if (r == 0) continue;
    for (j = i + 1; j < n; ++j) {
      if (a[j].second > a[i].second && a[j].first == a[i].first) {
        d = 1;
        break;
      }
    }
    if (d == 0) continue;
    if (u && d && l && r) {
      c++;
      continue;
    }
  }
  cout << c;
  return 0;
}
