#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, ans = 0;
  cin >> n;
  pair<int, int> p[202];
  for (int i = 0; i < n; i++) cin >> p[i].first >> p[i].second;
  sort(p, p + n);
  for (int i = 0; i < n; i++) {
    int x = 0;
    for (int j = n - 1; j >= 0; j--) {
      if (p[i].first < p[j].first and p[i].second == p[j].second) {
        x++;
        break;
      }
    }
    for (int j = 0; j < n; j++) {
      if (p[i].first > p[j].first and p[i].second == p[j].second) {
        x++;
        break;
      }
    }
    for (int j = i - 1; j >= 0; j--) {
      if (p[i].first == p[j].first and p[i].second > p[j].second) {
        x++;
        break;
      }
    }
    for (int j = i + 1; j < n; j++) {
      if (p[i].first == p[j].first and p[i].second < p[j].second) {
        x++;
        break;
      }
    }
    if (x == 4) ans++;
  }
  cout << ans << endl;
  return 0;
}
