#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, l, c, d, p, count = 0, n2 = 0;
  cin >> n;
  long long x[n];
  long long y[n];
  for (int i = 0; i < (n); i++) {
    cin >> x[i];
    cin >> y[i];
  }
  bool b1, b2, b3, b4;
  for (int i = 0; i < (n); i++) {
    b1 = false;
    b2 = false;
    b3 = false;
    b4 = false;
    for (int j = 0; j < (n); j++) {
      if (x[i] == x[j] and y[i] < y[j]) b1 = true;
      if (x[i] == x[j] and y[i] > y[j]) b2 = true;
      if (x[i] > x[j] and y[i] == y[j]) b3 = true;
      if (x[i] < x[j] and y[i] == y[j]) b4 = true;
    }
    if (b1 and b2 and b3 and b4) count++;
  }
  cout << count;
  return 0;
}
