#include <bits/stdc++.h>
using namespace std;
struct point {
  int x;
  int y;
};
int main() {
  int n;
  cin >> n;
  point arr[n];
  int i = 0;
  while (i < n) {
    cin >> arr[i].x;
    cin >> arr[i].y;
    ++i;
  }
  bool left = false;
  bool right = false;
  bool lower = false;
  bool upper = false;
  int count = 0;
  i = 0;
  while (i < n) {
    int j = 0;
    left = false;
    right = false;
    lower = false;
    upper = false;
    while (j < n) {
      if (i != j) {
        if (arr[j].x < arr[i].x && arr[i].y == arr[j].y) {
          left = true;
        }
        if (arr[j].x > arr[i].x && arr[i].y == arr[j].y) {
          right = true;
        }
        if (arr[j].x == arr[i].x && arr[i].y > arr[j].y) {
          lower = true;
        }
        if (arr[j].x == arr[i].x && arr[i].y < arr[j].y) {
          upper = true;
        }
      }
      ++j;
    }
    if (left && right && lower && upper) {
      count++;
    }
    ++i;
  }
  cout << count << endl;
  return 0;
}
