#include <bits/stdc++.h>
using namespace std;
int n, xx, yy, ans = 0;
vector<int> x[2222], y[2222];
pair<int, int> arr[222];
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%d%d", &xx, &yy);
    arr[i] = make_pair(xx, yy);
    x[xx < 0 ? abs(xx) + 1000 : xx].push_back(yy);
    y[yy < 0 ? abs(yy) + 1000 : yy].push_back(xx);
  }
  for (int i = 0; i < 2222; i++) {
    sort(x[i].begin(), x[i].end());
    sort(y[i].begin(), y[i].end());
  }
  for (int i = 0; i < n; i++) {
    xx = arr[i].first, yy = arr[i].second;
    ans += (x[xx < 0 ? abs(xx) + 1000 : xx][0] < yy &&
            x[xx < 0 ? abs(xx) + 1000 : xx]
             [x[xx < 0 ? abs(xx) + 1000 : xx].size() - 1] > yy &&
            y[yy < 0 ? abs(yy) + 1000 : yy][0] < xx &&
            y[yy < 0 ? abs(yy) + 1000 : yy]
             [y[yy < 0 ? abs(yy) + 1000 : yy].size() - 1] > xx);
  }
  printf("%d", ans);
  return 0;
}
