#include <bits/stdc++.h>
using namespace std;
int count_digits(int n) {
  string num = to_string(n);
  return num.size();
}
bool sort_des(int a, int b) { return a > b; }
void print(int a[], int n) {
  for (int i = 0; i < n; i++) {
    cout << a[i] << " ";
  }
}
void solve() {
  int n;
  cin >> n;
  long long X[n + 1], Y[n + 1];
  for (int i = 0; i < n; i++) {
    cin >> X[i] >> Y[i];
  }
  long long l, r, u, d, x, y;
  long long ans = 0;
  for (int i = 0; i < n; i++) {
    l = r = u = d = 0;
    x = X[i];
    y = Y[i];
    for (int j = 0; j < n; j++) {
      if (X[j] == x) {
        if (Y[j] > y) u++;
        if (Y[j] < y) d++;
      }
      if (Y[j] == y) {
        if (X[j] > x) r++;
        if (X[j] < x) l++;
      }
    }
    if (l > 0 && r > 0 && d > 0 && u > 0) ans++;
  }
  cout << ans;
}
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  int t = 1;
  while (t--) {
    solve();
    cout << "\n";
  }
  return 0;
}
