#include <bits/stdc++.h>
using namespace std;
bool ok(int a, int b, int c, int d) {
  if (a == 1 && b == 1 && c == 1 && d == 1)
    return true;
  else
    return false;
}
int main() {
  ios_base::sync_with_stdio();
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  int n, i, j, x, y, l = 0, r = 0, u = 0, d = 0, c = 0, s = 0;
  cin >> n;
  vector<int> a, b;
  for (i = 0; i < n; i++) {
    cin >> x >> y;
    a.push_back(x);
    b.push_back(y);
  }
  x = 0, y = 0;
  for (i = 0; i < n; i++) {
    l = 0, r = 0, u = 0, d = 0;
    x = a[i], y = b[i];
    for (j = 0; j < n; j++) {
      if (y == b[j]) {
        if (x > a[j])
          l = 1;
        else if (x < a[j])
          r = 1;
      }
      if (x == a[j]) {
        if (y > b[j])
          d = 1;
        else if (y < b[j])
          u = 1;
      }
    }
    if (ok(l, r, u, d) == true) c++;
  }
  cout << c << endl;
  ;
  return 0;
  ;
}
