#include <bits/stdc++.h>
using namespace std;
const long long Mod = 1e9 + 7;
const double pi = 2 * acos(0.0);
int main() {
  int n;
  scanf("%d", &(n));
  map<int, set<int>> ys;
  map<int, set<int>> xs;
  for (int i = 0; i < n; i++) {
    int x, y;
    scanf("%d %d", &x, &y);
    ys[x].insert(y);
    xs[y].insert(x);
  }
  if (int((xs).size()) < 3 || int((ys).size()) < 3) return puts("0");
  int ans = 0;
  for (auto it = (++xs.begin()); it != (--xs.end()); it++) {
    int y = it->first;
    if (int((it->second).size()) < 3) continue;
    for (auto it2 = (++it->second.begin()); it2 != (--it->second.end());
         it2++) {
      int x = *it2;
      int l = *(ys[x].begin()), r = *(ys[x].rbegin());
      if (l < y && r > y) ans++;
    }
  }
  printf("%d", (ans));
  return 0;
}
