#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  vector<pair<int, int> > v;
  cin >> n;
  for (int i = 0; i < n; i++) {
    int x, y;
    cin >> x >> y;
    v.push_back({x, y});
  }
  int ddif;
  int ans = 0;
  for (int i = 0; i < n; i++) {
    int x, y;
    x = v[i].first;
    y = v[i].second;
    int mask = 0;
    for (int j = 0; j < n; j++) {
      int nx = v[j].first;
      int ny = v[j].second;
      if (nx == x) {
        if (ny > y) mask |= 1;
        if (ny < y) mask |= 1 << 1;
      }
      if (ny == y) {
        if (nx < x) mask |= 1 << 2;
        if (nx > x) mask |= 1 << 3;
      }
    }
    if (mask == (1 << 4) - 1) ans++;
  }
  cout << ans << endl;
}
