#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int n;
  cin >> n;
  vector<pair<int, int>> v;
  int x, y;
  for (int i = 0; i < n; ++i) {
    cin >> x >> y;
    v.push_back(make_pair(x, y));
  }
  int superc = 0;
  for (int i = 0; i < n; ++i) {
    int up = 0, down = 0, right = 0, left = 0;
    for (int j = 0; j < n; ++j) {
      if (v[i].first == v[j].first) {
        if (v[i].second > v[j].second) {
          up++;
        }
        if (v[i].second < v[j].second) {
          down++;
        }
      }
      if (v[i].second == v[j].second) {
        if (v[i].first > v[j].first) {
          right++;
        }
        if (v[i].first < v[j].first) {
          left++;
        }
      }
    }
    if (left > 0 && right > 0 && up > 0 && down > 0) {
      superc++;
    }
  }
  cout << superc << endl;
}
