#include <bits/stdc++.h>
#pragma hdrstop
#pragma argsused
using namespace std;
int main(int argc, char* argv[]) {
  int i, j, resp, resn, resv, resl, res, n, a, b;
  vector<int> x, y;
  scanf("%d", &n);
  for (i = 0; i < n; i++) {
    scanf("%d %d", &a, &b);
    x.push_back(a);
    y.push_back(b);
  }
  res = 0;
  for (i = 0; i < n; i++) {
    resv = 0;
    resn = 0;
    resp = 0;
    resl = 0;
    for (j = 0; j < n; j++) {
      if (i != j) {
        if (x[i] == x[j] && y[i] > y[j])
          resn++;
        else if (x[i] == x[j] && y[i] < y[j])
          resv++;
        else if (x[i] > x[j] && y[i] == y[j])
          resl++;
        else if (x[i] < x[j] && y[i] == y[j])
          resp++;
      }
      if (resp != 0 && resl != 0 && resv != 0 && resn != 0) {
        res++;
        break;
      }
    }
  }
  printf("%d", res);
  return 0;
}
