#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  int X[N];
  int Y[N];
  for (int i = 0; i < N; i++) {
    cin >> X[i] >> Y[i];
  }
  int count = 0;
  bool left = false;
  bool right = false;
  bool up = false;
  bool down = false;
  for (int i = 0; i < N; i++) {
    for (int j = 0; j < N; j++) {
      if (i != j) {
        if (X[i] == X[j]) {
          if (Y[j] > Y[i]) {
            up = true;
          } else {
            down = true;
          }
        }
        if (Y[i] == Y[j]) {
          if (X[j] > X[i]) {
            right = true;
          } else {
            left = true;
          }
        }
      }
    }
    if (left && right && up && down) {
      count++;
    }
    left = false;
    right = false;
    up = false;
    down = false;
  }
  cout << count << endl;
  return 0;
}
