#include <bits/stdc++.h>
using namespace std;
const long long int MOD = 1000000007;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n, ans = 0;
  cin >> n;
  int x[n], y[n];
  for (int i = 0; i < n; i++) {
    cin >> x[i] >> y[i];
  }
  for (int i = 0; i < n; i++) {
    int count = 0, leftCount = 0, rightCount = 0, downCount = 0, upCount = 0;
    for (int j = 0; j < n; j++) {
      if (i == j) {
        continue;
      } else {
        if (x[j] < x[i] && y[j] == y[i]) {
          leftCount++;
          if (leftCount == 1) count++;
        } else if (x[j] > x[i] && y[j] == y[i]) {
          rightCount++;
          if (rightCount == 1) count++;
        } else if (y[j] < y[i] && x[j] == x[i]) {
          downCount++;
          if (downCount == 1) count++;
        } else if (y[j] > y[i] && x[j] == x[i]) {
          upCount++;
          if (upCount == 1) count++;
        }
      }
      if (count == 4) {
        ans++;
        break;
      }
    }
  }
  cout << ans;
  return 0;
}
