#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, x, y;
  int cnt = 0;
  bool left, right, up, down;
  left = right = up = down = false;
  vector<pair<int, int>> xxx;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> x >> y;
    xxx.push_back(make_pair(x, y));
  }
  for (int i = 0; i < n; i++) {
    x = xxx[i].first;
    y = xxx[i].second;
    for (int j = 0; j < n; j++) {
      if (!left && x > xxx[j].first && y == xxx[j].second) left = true;
      if (!right && x < xxx[j].first && y == xxx[j].second) right = true;
      if (!up && x == xxx[j].first && y < xxx[j].second) up = !up;
      if (!down && x == xxx[j].first && y > xxx[j].second) down = !down;
    }
    if (left && right && up && down) cnt++;
    left = right = up = down = false;
  }
  cout << cnt;
  return 0;
}
