#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, t = 0, d = 0, k = 0, m = 0, l = 0;
  cin >> n;
  int a[n][2];
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < 2; j++) {
      cin >> a[i][j];
    }
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      if ((a[i][0] > a[j][0] && a[j][1] == a[i][1]))
        t++;
      else if ((a[i][0] < a[j][0] && a[j][1] == a[i][1]))
        k++;
      else if ((a[i][1] > a[j][1] && a[j][0] == a[i][0]))
        l++;
      else if ((a[i][1] < a[j][1] && a[j][0] == a[i][0]))
        m++;
    }
    if (t > 0 && k > 0 && l > 0 && m > 0) d++;
    t = 0;
    k = 0;
    l = 0;
    m = 0;
  }
  cout << d;
}
