#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int x[10005], y[100005];
  for (int i = 1; i <= n; i++) cin >> x[i] >> y[i];
  int up[10005], down[100005], left[100005], right[100005];
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= n; j++) {
      if (i == j)
        continue;
      else {
        if (x[j] > x[i] && y[j] == y[i]) right[i] = 1;
        if (x[j] < x[i] && y[j] == y[i]) left[i] = 1;
        if (x[j] == x[i] && y[j] > y[i]) up[i] = 1;
        if (x[j] == x[i] && y[j] < y[i]) down[i] = 1;
      }
    }
  int sum = 0;
  for (int i = 1; i <= n; i++) {
    if (up[i] == down[i] && up[i] == left[i] && left[i] == right[i] &&
        up[i] == 1)
      sum++;
  }
  cout << sum << endl;
  return 0;
}
