#include <bits/stdc++.h>
using namespace std;
int main() {
  vector<int> nX, nY;
  bool north = false, south = false, east = false, west = false;
  int N, x, y, count = 0, srsCount = 0;
  cin >> N;
  for (int i = 0; i < N; i++) {
    cin >> x >> y;
    nX.push_back(x);
    nY.push_back(y);
  }
  for (int i = 0; i < N; i++) {
    for (int j = 0; j < N; j++) {
      if (i == j) continue;
      if (nX[j] > nX[i] && nY[j] == nY[i] && !north) {
        count++;
        north = true;
      } else if (nX[j] < nX[i] && nY[j] == nY[i] && !south) {
        count++;
        south = true;
      } else if (nX[j] == nX[i] && nY[j] < nY[i] && !east) {
        count++;
        east = true;
      } else if (nX[j] == nX[i] && nY[j] > nY[i] && !west) {
        count++;
        west = true;
      }
      if (count == 4) {
        srsCount++;
        break;
      }
    }
    count = 0;
    north = south = east = west = false;
  }
  cout << srsCount << "\n";
}
