#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int x[n], y[n];
  for (int i = 0; i < n; i++) {
    cin >> x[i] >> y[i];
  }
  int count = 0, ans = 0;
  for (int i = 0; i < n; i++) {
    int countup = 0, countdown = 0, countleft = 0, countright = 0;
    for (int j = 0; j < n; j++) {
      if (x[i] == x[j] && y[i] > y[j] && countup == 0) {
        countup++;
        if (countup == 1 && countdown == 1 && countleft == 1 && countright == 1)
          ans++;
      }
      if (x[i] == x[j] && y[i] < y[j] && countdown == 0) {
        countdown++;
        if (countup == 1 && countdown == 1 && countleft == 1 && countright == 1)
          ans++;
      }
      if (y[i] == y[j] && x[i] > x[j] && countright == 0) {
        countright++;
        if (countup == 1 && countdown == 1 && countleft == 1 && countright == 1)
          ans++;
      }
      if (y[i] == y[j] && x[i] < x[j] && countleft == 0) {
        countleft++;
        if (countup == 1 && countdown == 1 && countleft == 1 && countright == 1)
          ans++;
      }
    }
  }
  cout << ans;
}
