#include <bits/stdc++.h>
using namespace std;
int x[210], y[210];
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < (int)n; ++i) {
    cin >> x[i] >> y[i];
  }
  int res = 0;
  for (int i = 0; i < (int)n; ++i) {
    int bit = 0;
    for (int j = 0; j < (int)n; ++j) {
      if (x[i] < x[j] && y[i] == y[j]) bit |= 1;
      if (x[i] > x[j] && y[i] == y[j]) bit |= 2;
      if (x[i] == x[j] && y[i] < y[j]) bit |= 4;
      if (x[i] == x[j] && y[i] > y[j]) bit |= 8;
    }
    if (bit == 15) ++res;
  }
  cout << res << endl;
  return 0;
}
