#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, a, b, total = 0;
  scanf("%d", &n);
  pair<int, int> points[n];
  map<int, set<int> > pointsX;
  map<int, set<int> > pointsY;
  for (int i = 0; i < n; i++) {
    scanf("%d%d", &points[i].first, &points[i].second);
    pointsX[points[i].first].insert(points[i].second);
    pointsY[points[i].second].insert(points[i].first);
  }
  for (int i = 0; i < n; i++) {
    if (!(*pointsX[points[i].first].rbegin() > points[i].second)) continue;
    if (!(*pointsX[points[i].first].begin() < points[i].second)) continue;
    if (!(*pointsY[points[i].second].rbegin() > points[i].first)) continue;
    if (!(*pointsY[points[i].second].begin() < points[i].first)) continue;
    total++;
  }
  printf("%d\n", total);
  return 0;
}
