#include <bits/stdc++.h>
using namespace std;
int main() {
  int numOfPoints;
  cin >> numOfPoints;
  int points[numOfPoints][2];
  int currPointX, currPointY;
  for (int i = 0; i < numOfPoints; ++i) {
    cin >> currPointX >> currPointY;
    points[i][0] = currPointX;
    points[i][1] = currPointY;
  }
  int supercentrals = 0;
  for (int i = 0; i < numOfPoints; ++i) {
    bool leftNeighbor = false;
    bool rightNeighbor = false;
    bool lowerNeighbor = false;
    bool upperNeighbor = false;
    for (int j = 0; j < numOfPoints; ++j) {
      if ((points[i][1] == points[j][1]) && (points[j][0] < points[i][0])) {
        leftNeighbor = true;
      } else if ((points[i][1] == points[j][1]) &&
                 (points[j][0] > points[i][0])) {
        rightNeighbor = true;
      } else if ((points[i][0] == points[j][0]) &&
                 (points[j][1] < points[i][1])) {
        lowerNeighbor = true;
      } else if ((points[i][0] == points[j][0]) &&
                 (points[j][1] > points[i][1])) {
        upperNeighbor = true;
      }
    }
    if (leftNeighbor && rightNeighbor && lowerNeighbor && upperNeighbor)
      supercentrals++;
  }
  cout << supercentrals;
}
