#include <bits/stdc++.h>
using namespace std;
const int N = int(1e5 + 3);
vector<pair<int, int> > v;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n;
  cin >> n;
  for (int i = 0; i < n; i += 1) {
    int x, y;
    cin >> x >> y;
    v.push_back({x, y});
  }
  int ans = 0;
  int a, b, c, d;
  for (int i = 0; i < n; i += 1) {
    a = v[i].first;
    b = v[i].second;
    int U = 0, L = 0, l = 0, r = 0;
    for (int j = 0; j < n; j += 1) {
      c = v[j].first;
      d = v[j].second;
      if (a == c && b < d) U++;
      if (a == c && b > d) L++;
      if (a < c && b == d) l++;
      if (a > c && b == d) r++;
    }
    if (U && L && l && r) ans++;
  }
  printf("%d\n", ans);
  return 0;
}
