#include <bits/stdc++.h>
using namespace std;
int a[201], b[201];
int main() {
  int n, i, j, s1, s2, s3, s4, kol = 0;
  cin >> n;
  for (i = 1; i <= n; i++) cin >> a[i] >> b[i];
  for (i = 1; i <= n; i++) {
    s1 = s2 = s3 = s4 = 0;
    for (j = 1; j <= n; j++) {
      if (a[i] > a[j] && b[i] == b[j])
        s1 = 1;
      else if (a[i] < a[j] && b[i] == b[j])
        s2 = 1;
      else if (a[i] == a[j] && b[i] < b[j])
        s3 = 1;
      else if (a[i] == a[j] && b[i] > b[j])
        s4 = 1;
      if (s1 + s2 + s3 + s4 == 4) {
        kol++;
        break;
      }
    }
  }
  cout << kol;
  return 0;
}
