#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<pair<int, int>> points(n);
  bool left, right, up, down;
  int count = 0;
  for (int i = 0; i < n; i++) {
    int x, y;
    cin >> x >> y;
    points[i] = make_pair(x, y);
  }
  for (int j = 0; j < n; ++j) {
    left = right = up = down = false;
    for (int i = 0; i < n; ++i) {
      if (!left && (points[i].first < points[j].first &&
                    points[i].second == points[j].second)) {
        left = true;
      }
      if (!right && (points[i].first > points[j].first &&
                     points[i].second == points[j].second)) {
        right = true;
      }
      if (!up && (points[i].first == points[j].first &&
                  points[i].second > points[j].second)) {
        up = true;
      }
      if (!down && (points[i].first == points[j].first &&
                    points[i].second < points[j].second)) {
        down = true;
      }
      if (left && right && up && down) {
        count++;
        break;
      }
    }
  }
  cout << count;
  return 0;
}
