#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-10, inf = 1e10;
int n;
pair<int, int> v[300];
int main() {
  cin >> n;
  for (int(i) = 0; (i) < (n); (i)++) cin >> v[i].first >> v[i].second;
  int ans = 0;
  for (int(i) = 0; (i) < (n); (i)++) {
    bool a, b, c, d;
    a = b = c = d = false;
    for (int(j) = 0; (j) < (n); (j)++)
      if (i != j) {
        int x = v[i].first, y = v[i].second, xx = v[j].first, yy = v[j].second;
        if (xx > x && y == yy) a = 1;
        if (xx < x && y == yy) b = 1;
        if (x == xx && yy < y) c = 1;
        if (x == xx && yy > y) d = 1;
      }
    ans += int(a && b && c && d);
  }
  cout << ans;
  return 0;
}
