#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  scanf("%d", &n);
  int x[n + 1], y[n + 1];
  for (int i = 1; i <= n; ++i) {
    scanf("%d", &x[i]), scanf("%d", &y[i]);
  }
  int counter = 0;
  for (int i = 1; i <= n; ++i) {
    int l = 0, r = 0, u = 0, b = 0;
    for (int j = 1; j <= n; ++j) {
      if (i == j) continue;
      if (x[i] == x[j]) {
        if (y[j] > y[i]) ++u;
        if (y[j] < y[i]) ++b;
      }
      if (y[i] == y[j]) {
        if (x[j] > x[i]) ++r;
        if (x[j] < x[i]) ++l;
      }
    }
    if (l != 0 && r != 0 && u != 0 && b != 0) ++counter;
  }
  printf("%d\n", counter);
  return 0;
}
