#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<pair<int, int>> v;
  for (int i = 0; i < n; i++) {
    int c1, c2;
    cin >> c1 >> c2;
    v.push_back(make_pair(c1, c2));
  }
  int ans = 0;
  for (int i = 0; i < v.size(); i++) {
    long long c1 = 0, c2 = 0, c3 = 0, c4 = 0;
    for (int j = 0; j < v.size(); j++) {
      if (j == i) continue;
      if (v[i].first == v[j].first) {
        if (v[i].second < v[j].second)
          c1++;
        else if (v[i].second > v[j].second)
          c2++;
      } else if (v[i].second == v[j].second) {
        if (v[i].first < v[j].first)
          c3++;
        else if (v[i].first > v[j].first)
          c4++;
      }
    }
    if (c1 >= 1 && c2 >= 1 && c3 >= 1 && c4 >= 1) ans++;
  }
  cout << ans;
  return (0);
}
