#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int t = 1;
  while (t--) {
    int n;
    cin >> n;
    vector<pair<int, int>> a;
    int x, y;
    for (int i = 0; i < n; ++i) {
      cin >> x >> y;
      a.push_back(make_pair(x, y));
    }
    sort(a.begin(), a.end());
    int count = 0;
    int pos = 0;
    for (int i = n - 2; i >= 0; --i) {
      if (a[i].first != a[n - 1].first) {
        pos = i;
        break;
      }
    }
    int flag3 = 0, flag4 = 0;
    int flag = 0, flag1 = 0;
    for (int k = 0; k < n; ++k) {
      flag3 = 0, flag4 = 0;
      for (int i = 0; i < n; ++i) {
        if (a[k].first > a[i].first && a[k].second == a[i].second)
          flag3 = 1;
        else if (a[k].first < a[i].first && a[k].second == a[i].second)
          flag4 = 1;
        if (flag3 == 1 && flag4 == 1) break;
      }
      if (flag3 == 1 && flag4 == 1) {
        flag = 0, flag1 = 0;
        for (int j = 0; j < n; ++j) {
          if (a[k].first == a[j].first && a[k].second > a[j].second &&
              flag == 0)
            flag = 1;
          else if (a[k].first == a[j].first && a[k].second < a[j].second &&
                   flag1 == 0)
            flag1 = 1;
          if (flag == 1 && flag1 == 1) break;
        }
        if (flag == 1 && flag1 == 1) count++;
      }
    }
    cout << count;
  }
}
