#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n;
  cin >> n;
  vector<pair<int, int>> v;
  for (int i = 0; i < n; i++) {
    long long a, b;
    cin >> a >> b;
    v.push_back(make_pair(a, b));
  }
  int c = 0;
  for (int i = 0; i < n; i++) {
    int up = 0, lo = 0, r = 0, l = 0;
    for (int j = 0; j < n; j++) {
      if (v[i].first > v[j].first && v[i].second == v[j].second) up = 1;
      if (v[i].first < v[j].first && v[i].second == v[j].second) lo = 1;
      if (v[i].first == v[j].first && v[i].second < v[j].second) l = 1;
      if (v[i].first == v[j].first && v[i].second > v[j].second) r = 1;
    }
    if (up + lo + l + r == 4) c++;
  }
  cout << c;
}
