#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, x, y;
  int cnt = 0;
  cin >> n;
  bool first = false, second = false, third = false, forth = false;
  pair<int, int> arr[205];
  for (int i = 0; i < n; i++) {
    cin >> x >> y;
    arr[i] = make_pair(x, y);
  }
  for (int i = 0; i < n; i++) {
    first = false, second = false, third = false, forth = false;
    for (int j = 0; j < n; j++) {
      if (i == j) continue;
      if (arr[i].second == arr[j].second && arr[i].first > arr[j].first)
        first = true;
      if (arr[i].second == arr[j].second && arr[i].first < arr[j].first)
        second = true;
      if (arr[i].first == arr[j].first && arr[i].second > arr[j].second)
        third = true;
      if (arr[i].first == arr[j].first && arr[i].second < arr[j].second)
        forth = true;
      if (first & second & third & forth) {
        cnt++;
        break;
      }
    }
  }
  cout << cnt;
  return 0;
}
