#include <bits/stdc++.h>
using namespace std;
int n, x, y, ans, c;
bool _1, _2, _3, _4;
vector<pair<int, int>> sally;
int main() {
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> x >> y;
    sally.push_back({x, y});
  }
  for (int i = 0; i < n; ++i) {
    ans = 0;
    _1 = false, _4 = false, _3 = false, _2 = false;
    for (int j = 0; j < n; ++j) {
      if (sally[i].first > sally[j].first && sally[i].second == sally[j].second)
        _1 = true;
      if (sally[i].first < sally[j].first && sally[i].second == sally[j].second)
        _2 = true;
      if (sally[i].first == sally[j].first && sally[i].second > sally[j].second)
        _3 = true;
      if (sally[i].first == sally[j].first && sally[i].second < sally[j].second)
        _4 = true;
    }
    if (_1 && _2 && _3 && _4) c++;
  }
  cout << c;
  return 0;
}
