#include <bits/stdc++.h>
using namespace std;
int n, d, dai, dem, vt, ck, max1, min1, kq, tong;
int a[100005][5];
void sol() {
  int i, j;
  int x1, x2, x3, x4;
  dem = 0;
  for (i = 0; i < n; i++) {
    x1 = 0;
    x2 = 0;
    x3 = 0;
    x4 = 0;
    for (j = 0; j < n; j++) {
      if (a[i][0] == a[j][0] && a[i][1] < a[j][1]) x1 = 1;
      if (a[i][0] == a[j][0] && a[i][1] > a[j][1]) x2 = 1;
      if (a[i][0] > a[j][0] && a[i][1] == a[j][1]) x3 = 1;
      if (a[i][0] < a[j][0] && a[i][1] == a[j][1]) x4 = 1;
    }
    if (x1 == 1 && x2 == 1 && x3 == 1 && x4 == 1) dem++;
  }
  cout << dem << endl;
}
int main() {
  int i, j;
  ck = 0;
  while (scanf("%d", &n) > 0) {
    for (i = 0; i < n; i++) {
      scanf("%d %d", &a[i][0], &a[i][1]);
    }
    sol();
  }
  return 0;
}
