#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<pair<int, int> > input;
  for (int i = 0; i < n; i++) {
    int x, y;
    cin >> x >> y;
    pair<int, int> p;
    p.first = x;
    p.second = y;
    input.push_back(p);
  }
  int out = 0;
  for (int i = 0; i < n; i++) {
    bool r = false, l = false, u = false, d = false;
    for (int j = 0; j < n; j++) {
      if (input[j].first == input[i].first && input[j].second > input[i].second)
        d = true;
      else if (input[j].first == input[i].first &&
               input[j].second < input[i].second)
        u = true;
      if (input[j].second == input[i].second && input[j].first > input[i].first)
        l = true;
      else if (input[j].second == input[i].second &&
               input[j].first < input[i].first)
        r = true;
    }
    if (r && l && u && d) out++;
  }
  cout << out << endl;
}
