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