#include <bits/stdc++.h>
using namespace std;
int n;
vector<pair<int, int> > points;
int central(int index) {
  bool l, r, N, s;
  l = r = N = s = false;
  for (int i = 0; i < n; i++) {
    if (index == i) continue;
    if (points[i].first < points[index].first &&
        points[i].second == points[index].second)
      l = true;
    if (points[i].first > points[index].first &&
        points[i].second == points[index].second)
      r = true;
    if (points[i].second < points[index].second &&
        points[i].first == points[index].first)
      N = true;
    if (points[i].second > points[index].second &&
        points[i].first == points[index].first)
      s = true;
  }
  return (l && r && s && N);
}
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    int a, b;
    scanf("%d %d", &a, &b);
    points.push_back(pair<int, int>(a, b));
  }
  int ans = 0;
  for (int i = 0; i < n; i++) {
    if (central(i)) ans++;
  }
  printf("%d\n", ans);
}
