#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, c1 = 0, c2 = 0, c3 = 0, c4 = 0, ans = 0;
  cin >> n;
  int x[n], y[n];
  for (int i = 0; i < n; i++) {
    cin >> x[i] >> y[i];
  }
  for (int j = 0; j < n; j++) {
    c1 = 0;
    c2 = 0;
    c3 = 0;
    c4 = 0;
    for (int k = 0; k < n; k++) {
      if (x[k] > x[j] && y[k] == y[j] && c1 == 0) {
        c1++;
      }
      if (x[k] < x[j] && y[k] == y[j] && c2 == 0) {
        c2++;
      }
      if (x[k] == x[j] && y[k] > y[j] && c3 == 0) {
        c3++;
      }
      if (x[k] == x[j] && y[k] < y[j] && c4 == 0) {
        c4++;
      }
      if (c1 == 1 && c2 == 1 && c3 == 1 && c4 == 1) {
        break;
      }
    }
    if (c1 == 1 && c2 == 1 && c3 == 1 && c4 == 1) {
      ans++;
    }
  }
  cout << ans;
}
