#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  int n, l, r, u, d, c = 0;
  cin >> n;
  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++) {
    l = 0, r = 0, u = 0, d = 0;
    for (int j = 0; j < n; j++) {
      if (a[i][0] == a[j][0] && a[i][1] > a[j][1])
        d = 1;
      else if (a[i][0] == a[j][0] && a[i][1] < a[j][1])
        u = 1;
      else if (a[i][0] < a[j][0] && a[i][1] == a[j][1])
        r = 1;
      else if (a[i][0] > a[j][0] && a[i][1] == a[j][1])
        l = 1;
    }
    if (d + u + r + l == 4) c++;
  }
  cout << c << endl;
  return 0;
}
