#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int s = 0;
  int a[n][2];
  for (int i = 0; i < n; i++) {
    cin >> a[i][0] >> a[i][1];
  }
  for (int i = 0; i < n; i++) {
    int r = 0, l = 0, lo = 0, u = 0;
    for (int j = 0; j < n; j++) {
      if (a[i][0] < a[j][0] && a[i][1] == a[j][1]) r = 1;
      if (a[i][0] > a[j][0] && a[i][1] == a[j][1]) l = 1;
      if (a[i][0] == a[j][0] && a[i][1] > a[j][1]) lo = 1;
      if (a[i][0] == a[j][0] && a[i][1] < a[j][1]) u = 1;
    }
    if (r == 1 && l == 1 && lo == 1 && u == 1) s++;
  }
  cout << s;
  return 0;
}
