#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, i, j, count = 0, left = 0, right = 0, lower = 0, upper = 0;
  cin >> n;
  int a[n][2];
  for (i = 0; i < n; i++) {
    for (j = 0; j < 2; j++) {
      cin >> a[i][j];
    }
  }
  for (i = 0; i < n; i++) {
    left = 0;
    right = 0;
    lower = 0;
    upper = 0;
    for (j = 0; j < n; j++) {
      if (a[j][0] > a[i][0] && a[j][1] == a[i][1]) {
        right = 1;
      }
      if (a[j][0] < a[i][0] && a[j][1] == a[i][1]) {
        left = 1;
      }
      if (a[j][0] == a[i][0] && a[j][1] < a[i][1]) {
        lower = 1;
      }
      if (a[j][0] == a[i][0] && a[j][1] > a[i][1]) {
        upper = 1;
      }
    }
    if (right == 1 && left == 1 && lower == 1 && upper == 1) {
      count++;
    }
  }
  cout << count;
}
