#include <bits/stdc++.h>
using namespace std;
int main() {
  int a;
  cin >> a;
  int x[a], y[a];
  for (int i = 0; i < a; i++) {
    cin >> x[i] >> y[i];
  }
  int count = 0;
  for (int i = 0; i < a; i++) {
    int one = 0, two = 0, three = 0, four = 0;
    for (int j = 0; j < a; j++) {
      if (i == j)
        continue;
      else {
        if (x[j] > x[i] && y[i] == y[j])
          one = 1;
        else if (x[j] < x[i] && y[j] == y[i])
          two = 1;
        else if (y[j] > y[i] && x[j] == x[i])
          three = 1;
        else if (y[j] < y[i] && x[j] == x[i])
          four = 1;
      }
    }
    if (one && two && three && four) count++;
  }
  cout << count;
}
