#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, c = 0, t = 0;
  cin >> n;
  int x[n], y[n];
  for (int i = 0; i < n; i++) cin >> x[i] >> y[i];
  while (c < n) {
    int i, a = 0, b = 0, d = 0, e = 0;
    for (int i = 0; i < n; i++) {
      if (x[c] < x[i] && y[c] == y[i]) a++;
      if (x[c] > x[i] && y[c] == y[i]) b++;
      if (y[c] < y[i] && x[c] == x[i]) d++;
      if (y[c] > y[i] && x[c] == x[i]) e++;
    }
    if (a > 0 && b > 0 && d > 0 && e > 0) t++;
    c++;
  }
  cout << t;
  return 0;
}
