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