#include <bits/stdc++.h>
using namespace std;
int n;
int x[201], y[201];
int f[201];
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; ++i) scanf("%d%d", &x[i], &y[i]);
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < n; ++j) {
      if (x[i] == x[j] && y[i] < y[j]) f[i] |= 1;
      if (x[i] == x[j] && y[i] > y[j]) f[i] |= 2;
      if (x[i] < x[j] && y[i] == y[j]) f[i] |= 4;
      if (x[i] > x[j] && y[i] == y[j]) f[i] |= 8;
    }
  }
  int ans = 0;
  for (int i = 0; i < n; ++i)
    if (f[i] == 15) ans++;
  printf("%d\n", ans);
  return 0;
}
