#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, c = 0;
  cin >> n;
  long long int A[n][2];
  for (long long int i = 0; i < n; i++) {
    cin >> A[i][0] >> A[i][1];
  }
  for (long long int i = 0; i < n; i++) {
    long long int right = 0, left = 0, bottom = 0, top = 0;
    for (long long int j = 0; j < n; j++) {
      if (A[i][0] == A[j][0]) {
        if (A[j][1] > A[i][1]) {
          right++;
        }
        if (A[j][1] < A[i][1]) {
          left++;
        }
      }
      if (A[i][1] == A[j][1]) {
        if (A[j][0] > A[i][0]) {
          bottom++;
        }
        if (A[j][0] < A[i][0]) {
          top++;
        }
      }
    }
    if (right != 0 && left != 0 && bottom != 0 && top != 0) {
      c++;
    }
  }
  cout << c;
  return 0;
}
