#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  int counter = 0;
  cin >> n;
  int x[n], y[n];
  for (int i = 0; i < n; i++) {
    scanf("%d %d", &x[i], &y[i]);
  }
  for (int i = 0; i < n; i++) {
    int count1 = 0, count2 = 0, count3 = 0, count4 = 0;
    for (int j = 0; j < n; j++) {
      if (x[i] < x[j] && y[i] == y[j]) {
        count1++;
      }
      if (x[i] > x[j] && y[i] == y[j]) {
        count2++;
      }
      if (x[i] == x[j] && y[i] < y[j]) {
        count3++;
      }
      if (x[i] == x[j] && y[i] > y[j]) {
        count4++;
      }
    }
    if (count1 >= 1 && count2 >= 1 && count3 >= 1 && count4 >= 1) {
      counter++;
    }
  }
  cout << counter;
  return 0;
}
