#include <bits/stdc++.h>
inline bool get(int &t) {
  bool flag = 0;
  char c;
  while (!isdigit(c = getchar()) && c != '-')
    if (c == -1) break;
  if (c == -1) return 0;
  if (c == '-')
    flag = 1, t = 0;
  else
    t = c ^ 48;
  while (isdigit(c = getchar())) t = (t << 1) + (t << 3) + (c ^ 48);
  if (flag) t = -t;
  return 1;
}
const int INF = 100000;
const int NINF = -100000;
const int maxn = 2048;
int maxx[maxn], maxy[maxn], minx[maxn], miny[maxn], n, x[maxn], y[maxn];
int main() {
  int i, ans;
  while (get(n)) {
    for (i = 0; i < maxn; i++)
      maxx[i] = maxy[i] = NINF, minx[i] = miny[i] = INF;
    for (i = 0; i < n; i++) {
      get(x[i]);
      get(y[i]);
      x[i] += 1000;
      y[i] += 1000;
      if (maxx[x[i]] < y[i]) maxx[x[i]] = y[i];
      if (maxy[y[i]] < x[i]) maxy[y[i]] = x[i];
      if (minx[x[i]] > y[i]) minx[x[i]] = y[i];
      if (miny[y[i]] > x[i]) miny[y[i]] = x[i];
    }
    for (ans = i = 0; i < n; i++) {
      if (maxx[x[i]] > y[i] && minx[x[i]] < y[i] && maxy[y[i]] > x[i] &&
          miny[y[i]] < x[i])
        ans++;
    }
    printf("%d\n", ans);
  }
}
