#include <bits/stdc++.h>
using namespace std;
int main() {
  int t, i, j, count = 0;
  cin >> t;
  int a[t], b[t];
  for (i = 0; i < t; i++) cin >> a[i] >> b[i];
  for (int i = 0; i < t; i++) {
    int e = 0, f = 0, c = 0, d = 0;
    for (j = 0; j < t; j++) {
      if (a[i] < a[j] && b[i] == b[j]) e = 1;
      if (a[i] > a[j] && b[i] == b[j]) f = 1;
      if (a[i] == a[j] && b[i] > b[j]) c = 1;
      if (a[i] == a[j] && b[i] < b[j]) d = 1;
    }
    if (e + f + c + d == 4) count++;
  }
  cout << count << "\n";
  return 0;
}
