#include <bits/stdc++.h>
using namespace std;
class Point {
 public:
  int x, y;
  bool up, low, left, right;
  bool isSuper() { return (up && low && left && right); }
  Point() {
    x = y = 0;
    up = low = left = right = false;
  }
};
int main() {
  int n;
  cin >> n;
  vector<Point> points(n);
  for (int i = 0; i < n; i++) {
    cin >> points[i].x >> points[i].y;
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      if (i == j) continue;
      if (points[i].x == points[j].x) {
        if (points[i].y < points[j].y) {
          points[i].low = true;
          points[j].up = true;
        } else {
          points[i].up = true;
          points[j].low = true;
        }
      } else if (points[i].y == points[j].y) {
        if (points[i].x < points[j].x) {
          points[i].left = true;
          points[j].right = true;
        } else {
          points[i].right = true;
          points[j].left = true;
        }
      }
    }
  }
  int counter = 0;
  for (int i = 0; i < n; i++) {
    if (points[i].isSuper()) counter++;
  }
  cout << counter;
  return 0;
}
