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