#include <bits/stdc++.h>
using namespace std;
int n, x[500], y[500], u, l, r, d, ans;
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) cin >> x[i] >> y[i];
  for (int i = 0; i < n; i++) {
    d = u = r = l = 0;
    for (int j = 0; j < n; j++) {
      if (x[i] == x[j] && y[i] < y[j]) d = 1;
      if (x[i] == x[j] && y[i] > y[j]) u = 1;
      if (y[i] == y[j] && x[i] < x[j]) l = 1;
      if (y[i] == y[j] && x[i] > x[j]) r = 1;
    }
    if (d + u + l + r == 4) ans++;
  }
  cout << ans;
  return 0;
}
