#include <bits/stdc++.h>
using namespace std;
vector<pair<int, int> > points;
int n;
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i) {
    int x, y;
    scanf("%d%d", &x, &y);
    points.push_back(pair<int, int>(x, y));
  }
  int ans = 0;
  for (int i = 0; i < points.size(); ++i) {
    bool left = false, right = false, low = false, up = false;
    for (int j = 0; j < points.size(); ++j) {
      if (i == j) continue;
      if (points[j].first == points[i].first &&
          points[j].second < points[i].second)
        low = true;
      if (points[j].first == points[i].first &&
          points[j].second > points[i].second)
        up = true;
      if (points[j].first < points[i].first &&
          points[j].second == points[i].second)
        left = true;
      if (points[j].first > points[i].first &&
          points[j].second == points[i].second)
        right = true;
    }
    if (left && right && low && up) ++ans;
  }
  printf("%d\n", ans);
  return 0;
}
