#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, x, i, p, q, r, s, t, amit = 0, j;
  cin >> n;
  int arr[n][2];
  for (i = 0; i < n; i++) {
    for (j = 0; j < 2; j++) {
      cin >> arr[i][j];
    }
  }
  for (i = 0; i < n; i++) {
    p = 0;
    q = 0;
    r = 0;
    s = 0;
    t = 0;
    for (j = 0; j < n; j++) {
      if (arr[j][0] > arr[i][0] && arr[i][1] == arr[j][1]) p++;
      if (arr[j][0] < arr[i][0] && arr[i][1] == arr[j][1]) q++;
      if (arr[j][0] == arr[i][0] && arr[i][1] > arr[j][1]) r++;
      if (arr[j][0] == arr[i][0] && arr[i][1] < arr[j][1]) s++;
      if (p > 0 && q > 0 && r > 0 && s > 0 && t == 0) {
        amit++;
        t = 1;
      }
    }
  }
  cout << amit;
}
