#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<pair<int, int> > arr;
  for (int i = 0; i < n; i++) {
    int x, y;
    cin >> x >> y;
    arr.push_back(pair<int, int>(x, y));
  }
  int count = 0;
  for (int i = 0; i < n; i++) {
    int l = 0, r = 0, u = 0, d = 0;
    for (int j = 0; j < n; j++) {
      if (arr[i].first == arr[j].first && arr[i].second > arr[j].second) {
        u++;
      }
      if (arr[i].first == arr[j].first && arr[i].second < arr[j].second) {
        d++;
      }
      if (arr[i].first > arr[j].first && arr[i].second == arr[j].second) {
        r++;
      }
      if (arr[i].first < arr[j].first && arr[i].second == arr[j].second) {
        l++;
      }
      if (l > 0 && r > 0 && u > 0 && d > 0) {
        count++;
        break;
      }
    }
  }
  cout << count << endl;
  return 0;
}
