#include <bits/stdc++.h>
using namespace std;
int x[2020], y[2020], n, ans;
int was[2020][2020];
bool check1(int k) {
  for (int i = 0; i < n; i++)
    if (y[i] == y[k] && x[i] > x[k]) return 1;
  return 0;
}
bool check2(int k) {
  for (int i = 0; i < n; i++)
    if (y[i] == y[k] && x[i] < x[k]) return 1;
  return 0;
}
bool check3(int k) {
  for (int i = 0; i < n; i++)
    if (y[i] > y[k] && x[i] == x[k]) return 1;
  return 0;
}
bool check4(int k) {
  for (int i = 0; i < n; i++)
    if (y[i] < y[k] && x[i] == x[k]) return 1;
  return 0;
}
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> x[i] >> y[i];
  }
  for (int i = 0; i < n; i++) {
    if (check1(i) && check2(i) && check3(i) && check4(i)) ans++;
  }
  cout << ans;
  return 0;
}
