#include <bits/stdc++.h>
using namespace std;
const int maxn = 300;
int a[maxn][5];
int b[maxn][2];
int n;
void work() {
  int ans = 0;
  memset(a, 0, sizeof(a));
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++)
      if (i != j) {
        if (b[i][0] == b[j][0] && b[i][1] < b[j][1]) a[i][0] = 1;
        if (b[i][0] == b[j][0] && b[i][1] > b[j][1]) a[i][1] = 1;
        if (b[i][1] == b[j][1] && b[i][0] < b[j][0]) a[i][2] = 1;
        if (b[i][1] == b[j][1] && b[i][0] > b[j][0]) a[i][3] = 1;
      }
    int k = 0;
    for (int j = 0; j < 4; j++) k = k + a[i][j];
    if (k == 4) ans++;
  }
  printf("%d\n", ans);
}
void init() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%d%d", &b[i][0], &b[i][1]);
  }
}
int main() {
  init();
  work();
  return 0;
}
