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