#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int a[n][2];
  for (int i = 0; i < n; i++) cin >> a[i][0] >> a[i][1];
  int x, y, c = 0;
  int l, r, u, d;
  for (int j = 0; j < n; j++) {
    x = a[j][0];
    y = a[j][1];
    l = r = u = d = 0;
    for (int i = 0; i < n; i++) {
      if (i != j) {
        if (a[i][0] == x && a[i][1] > y)
          u = 1;
        else if (a[i][0] == x && a[i][1] < y)
          l = 1;
        else if (a[i][0] > x && a[i][1] == y)
          r = 1;
        else if (a[i][0] < x && a[i][1] == y)
          d = 1;
        else
          ;
      }
    }
    if (u + l + r + d == 4) c++;
  }
  cout << c << endl;
  return 0;
}
