#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  mt19937_64 rng(
      chrono::high_resolution_clock::now().time_since_epoch().count());
  int n, ans = 0;
  cin >> n;
  vector<array<int, 2>> v(n);
  for (auto& [x, y] : v) cin >> x >> y;
  for (int i = 0; i < n; ++i) {
    auto [x, y] = v[i];
    bool up = false, down = false, left = false, right = false;
    for (int j = 0; j < n; ++j) {
      if (i == j) continue;
      auto [x2, y2] = v[j];
      up |= (x == x2) and (y2 > y);
      down |= (x == x2) and (y2 < y);
      left |= (x > x2) and (y2 == y);
      right |= (x < x2) and (y2 == y);
    }
    ans += left & right & up & down;
  }
  cout << ans;
}
