#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  int u, d, l, r;
  cin >> n;
  int x[n];
  int y[n];
  int supercentral = 0;
  for (int i = 0; i < n; i++) {
    cin >> x[i];
    cin >> y[i];
  }
  for (int i = 0; i < n; i++) {
    u = 0;
    l = 0;
    d = 0;
    r = 0;
    for (int j = 0; j < n; j++)
      if (x[i] == x[j]) {
        if (y[i] < y[j])
          u++;
        else if (y[i] > y[j])
          d++;
      } else if (y[i] == y[j]) {
        if (x[i] < x[j])
          r++;
        else if (x[i] > x[j])
          l++;
      }
    if (u > 0 && l > 0 && r > 0 && d > 0) {
      supercentral++;
      continue;
    }
  }
  cout << supercentral;
  return 0;
}
