#include <bits/stdc++.h>
using namespace std;
bool up(int x, int y, int x2, int y2) {
  if (x == x2 and y2 > y) return true;
  return false;
}
bool down(int x, int y, int x2, int y2) {
  if (x == x2 and y2 < y) return true;
  return false;
}
bool left(int x, int y, int x2, int y2) {
  if (y == y2 and x2 < x) return true;
  return false;
}
bool right(int x, int y, int x2, int y2) {
  if (y == y2 and x2 > x) return true;
  return false;
}
int main() {
  int n, x, y, cont = 0;
  vector<pair<int, int>> vec;
  scanf(" %d", &n);
  for (int i = 0; i < n; i++) {
    scanf(" %d %d", &x, &y);
    vec.push_back({x, y});
  }
  for (int i = 0; i < n; i++) {
    int u = 0, d = 0, l = 0, r = 0;
    for (int j = 0; j < n; j++) {
      if (j != i) {
        u += up(vec[i].first, vec[i].second, vec[j].first, vec[j].second);
        d += down(vec[i].first, vec[i].second, vec[j].first, vec[j].second);
        l += left(vec[i].first, vec[i].second, vec[j].first, vec[j].second);
        r += right(vec[i].first, vec[i].second, vec[j].first, vec[j].second);
      }
    }
    if (u and d and l and r) cont++;
  }
  cout << cont << '\n';
}
