#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  pair<int, int> soma[n];
  for (int i = 0; i < n; i++) cin >> soma[i].first >> soma[i].second;
  int ans = 0;
  bool anas[4];
  for (int i = 0; i < n; i++) {
    anas[0] = false;
    anas[1] = false;
    anas[2] = false;
    anas[3] = false;
    for (int j = 0; j < n; j++) {
      if (j != i) {
        if (soma[j].first > soma[i].first && soma[i].second == soma[j].second)
          anas[0] = true;
        if (soma[j].first < soma[i].first && soma[j].second == soma[i].second)
          anas[1] = true;
        if (soma[j].first == soma[i].first && soma[j].second < soma[i].second)
          anas[2] = true;
        if (soma[j].first == soma[i].first && soma[j].second > soma[i].second)
          anas[3] = true;
      }
    }
    if (anas[0] && anas[1] && anas[2] && anas[3]) {
      ans++;
    }
  }
  cout << ans << endl;
  return 0;
}
