#include <bits/stdc++.h>
int main() {
  int n;
  scanf("%d", &n);
  int arr[n][2];
  int arr1[n][2];
  int i, j;
  for (i = 0; i < n; i++) {
    for (j = 0; j < 2; j++) {
      scanf("%d", &arr[i][j]);
      arr1[i][j] = arr[i][j];
    }
  }
  int max1, min1, max2, min2;
  max1 = arr[0][0];
  min1 = arr[0][0];
  max2 = arr[0][1];
  min2 = arr[0][1];
  for (i = 0; i < n; i++) {
    if (arr[i][0] > max1) max1 = arr[i][0];
    if (arr[i][0] < min1) min1 = arr[i][0];
    if (arr[i][1] > max2) max2 = arr[i][1];
    if (arr[i][1] < min2) min2 = arr[i][1];
  }
  for (i = 0; i < n; i++) {
    if (arr[i][0] >= max1) arr1[i][0] = -2000;
    if (arr[i][0] <= min1) arr1[i][0] = -2000;
    if (arr[i][1] >= max2) arr1[i][1] = -2000;
    if (arr[i][1] <= min2) arr1[i][1] = -2000;
  }
  int num1 = 0;
  int num2 = 0;
  int tst1 = 0;
  int tst2 = 0;
  int ts1 = 0;
  int ts2 = 0;
  int res = 0;
  for (i = 0; i < n; i++) {
    if (arr1[i][0] != -2000 && arr1[i][1] != -2000) {
      for (j = 0; j < n; j++) {
        if (arr[j][0] == arr1[i][0]) {
          num1++;
          if (arr1[i][1] - arr[j][1] > 0) tst1++;
          if (arr1[i][1] - arr[j][1] < 0) tst2++;
        }
        if (arr[j][1] == arr1[i][1]) {
          num2++;
          if (arr1[i][0] - arr[j][0] > 0) ts1++;
          if (arr1[i][0] - arr[j][0] < 0) ts2++;
        }
      }
    }
    if (num1 > 2 && num2 > 2 && tst1 != 0 && tst2 != 0 && ts1 != 0 &&
        ts2 != 0) {
      res++;
    }
    num1 = 0;
    num2 = 0;
    tst1 = 0;
    tst2 = 0;
    ts1 = 0;
    ts2 = 0;
  }
  printf("%d", res);
  return 0;
}
