#include <bits/stdc++.h>
using namespace std;
const double pi = acos(-1);
int n, m, a[100001] = {}, ans = 0, tmp1, tmp2;
vector<pair<int, int> > vp;
vector<int> debil;
bool first[4];
string second;
bool cmpvp(pair<int, int> p1, pair<int, int> p2) {
  if (p1.first < p2.first) return 1;
  if (p1.first == p2.first)
    if (p1.second < p2.second) return 1;
  return 0;
}
int main() {
  cin >> n;
  for (long long i = 0; i < n; ++i) {
    cin >> tmp1 >> tmp2;
    vp.push_back(make_pair(tmp1, tmp2));
  }
  for (long long i = 0; i < n; ++i) {
    first[0] = false;
    first[1] = false;
    first[2] = false;
    first[3] = false;
    for (long long j = 0; j < n; ++j) {
      if (vp[i].first == vp[j].first && vp[i].second < vp[j].second)
        first[0] = true;
      if (vp[i].first == vp[j].first && vp[i].second > vp[j].second)
        first[1] = true;
      if (vp[i].first < vp[j].first && vp[i].second == vp[j].second)
        first[2] = true;
      if (vp[i].first > vp[j].first && vp[i].second == vp[j].second)
        first[3] = true;
    }
    if (first[0] && first[1] && first[2] && first[3]) ++ans;
  }
  cout << ans << endl;
  return 0;
}
