#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  long long n;
  cin >> n;
  long long x[n], y[n];
  for (long long i = 0; i < n; i++) cin >> x[i] >> y[i];
  long long ans = 0;
  for (long long i = 0; i < n; i++) {
    long long rn = 0, ln = 0, un = 0, dn = 0;
    for (long long j = 0; j < n; j++) {
      if (i != j) {
        if (x[i] == x[j]) {
          if (y[i] < y[j])
            dn = 1;
          else
            un = 1;
        }
        if (y[i] == y[j]) {
          if (x[i] < x[j])
            rn = 1;
          else
            ln = 1;
        }
      }
    }
    if (ln * rn * dn * un == 1) ans++;
  }
  cout << ans << endl;
  return 0;
}
