#include <bits/stdc++.h>
using namespace std;
void solve();
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int t = 1;
  while (t--) {
    solve();
    cout << "\n";
  }
  cerr << "time taken : " << (float)clock() / CLOCKS_PER_SEC << " secs" << endl;
  return 0;
}
void solve() {
  int n;
  cin >> n;
  int a[n];
  int b[n];
  for (int i = 0; i < n; i++) {
    cin >> a[i] >> b[i];
  }
  int top = 0;
  int low{0};
  int left = 0;
  int right = 0;
  int count = 0;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      if (j != i) {
        if (a[j] == a[i] && b[j] > b[i])
          top = 1;
        else if (a[j] == a[i] && b[j] < b[i])
          low = 1;
        else if (b[j] == b[i] && a[j] > a[i])
          right = 1;
        else if (b[j] == b[i] && a[j] < a[i])
          left = 1;
      }
    }
    if (top + left + right + low == 4) count++;
    top = left = right = low = 0;
  }
  cout << count << '\n';
}
