#include <bits/stdc++.h>
using namespace std;
struct node {
  int MIN, MAX;
};
node x[2005];
node y[2005];
int X[1005];
int Y[1005];
int main(int argc, char** argv) {
  int n, a, b, i;
  int xmin, ymin, xmax, ymax;
  while (~scanf("%d", &n)) {
    for (i = 0; i <= 2002; i++) {
      x[i].MAX = -99999999;
      x[i].MIN = 99999999;
      y[i].MAX = -99999999;
      y[i].MIN = 99999999;
    }
    for (i = 1; i <= n; i++) {
      scanf("%d%d", &a, &b);
      a += 1000;
      b += 1000;
      if (a < y[b].MIN) y[b].MIN = a;
      if (a > y[b].MAX) y[b].MAX = a;
      if (b < x[a].MIN) x[a].MIN = b;
      if (b > x[a].MAX) x[a].MAX = b;
      X[i] = a;
      Y[i] = b;
    }
    if (n <= 4) {
      printf("0\n");
      continue;
    }
    int ans = 0;
    for (i = 1; i <= n; i++) {
      a = X[i];
      b = Y[i];
      if (x[a].MIN == x[a].MAX || b <= x[a].MIN || b >= x[a].MAX ||
          x[a].MAX == -99999999 || x[a].MIN == 99999999)
        continue;
      else if (y[b].MIN == y[b].MAX || a <= y[b].MIN || a >= y[b].MAX ||
               y[b].MAX == -99999999 || y[b].MIN == 99999999)
        continue;
      else
        ans++;
    }
    printf("%d\n", ans);
  }
  return 0;
}
