#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  int n = t;
  int arr[t][2];
  for (int i = 0; i < t; i++) {
    cin >> arr[i][0] >> arr[i][1];
  }
  int cnt = 0;
  for (int i = 0; i < t; i++) {
    int a = 0, b = 0, c = 0, d = 0;
    for (int j = 0; j < t; j++) {
      if (arr[i][0] == arr[j][0] && arr[i][1] > arr[j][1] && i != j)
        a = 1;
      else if (arr[i][0] == arr[j][0] && arr[i][1] < arr[j][1] && i != j)
        b = 1;
      else if (arr[i][1] == arr[j][1] && arr[i][0] > arr[j][0] && i != j)
        c = 1;
      else if (arr[i][1] == arr[j][1] && arr[i][0] < arr[j][0] && i != j)
        d = 1;
      if ((a * b * c * d) == 1) {
        cnt++;
        break;
      }
    }
  }
  cout << cnt << endl;
}
