#include <bits/stdc++.h>
using namespace std;
int x[5005][3], y[5005][3];
int n;
int x2[5005], y2[5005], ans;
int main() {
  cin >> n;
  for (int i = 0; i <= 5000; i++) {
    x[i][1] = 1000000;
    y[i][1] = 1000000;
    x[i][2] = -1000000;
    y[i][2] = -1000000;
  }
  for (int i = 1; i <= n; i++) {
    int a, b;
    cin >> a >> b;
    x2[i] = a + 2000;
    y2[i] = b + 2000;
    y[b + 2000][1] = min(y[b + 2000][1], a + 2000);
    y[b + 2000][2] = max(y[b + 2000][2], a + 2000);
    x[a + 2000][1] = min(x[a + 2000][1], b + 2000);
    x[a + 2000][2] = max(x[a + 2000][2], b + 2000);
  }
  for (int i = 1; i <= n; i++) {
    int a = x2[i];
    int b = y2[i];
    if (x[a][1] < b && x[a][2] > b && y[b][1] < a && y[b][2] > a) {
      ans++;
    }
  }
  cout << ans;
  return 0;
}
