#include <bits/stdc++.h>
using namespace std;
int n, r, l, u, lo, ans;
pair<int, int> arr[200];
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) scanf("%d %d", &arr[i].first, &arr[i].second);
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      if (arr[j].first == arr[i].first && arr[j].second > arr[i].second) r++;
      if (arr[j].first == arr[i].first && arr[j].second < arr[i].second) l++;
      if (arr[j].first > arr[i].first && arr[j].second == arr[i].second) u++;
      if (arr[j].first < arr[i].first && arr[j].second == arr[i].second) lo++;
    }
    if (r >= 1 && l >= 1 && u >= 1 && lo >= 1) ans++;
    r = 0;
    l = 0;
    u = 0;
    lo = 0;
  }
  printf("%d\n", ans);
}
