#include <bits/stdc++.h>
using namespace std;
int main() {
  int T;
  cin >> T;
  int a[T + 5], b[T + 5];
  for (int i = 0; i < T; i++) {
    cin >> a[i] >> b[i];
  }
  int cnt = 0;
  for (int i = 0; i < T; i++) {
    bool u = false, d = false, r = false, l = false;
    for (int j = 0; j < T; j++) {
      if (a[j] > a[i] && b[j] == b[i] && i != j) r = true;
      if (a[j] < a[i] && b[j] == b[i] && i != j) l = true;
      if (a[j] == a[i] && b[j] < b[i] && i != j) d = true;
      if (a[j] == a[i] && b[j] > b[i] && i != j) u = true;
    }
    if (r == true && l == true && d == true && u == true) cnt++;
  }
  cout << cnt << endl;
  return 0;
}
