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