#include <bits/stdc++.h>
using namespace std;
const int N = 2e2 + 7;
const int INF = 1e9 + 7;
const int MOD = 1e9 + 7;
const double Pi = acos(-1.0);
const double EPS = 1e-8;
int n;
struct Node {
  int x, y;
  void in() { scanf("%d%d", &x, &y); }
} a[N];
int main() {
  scanf("%d", &n);
  for (int i = (0); i < (n); ++i) a[i].in();
  int ans = 0;
  for (int i = (0); i < (n); ++i) {
    int st = 0;
    for (int j = (0); j < (n); ++j)
      if (a[j].x == a[i].x) {
        if (a[j].y < a[i].y)
          st |= 1;
        else if (a[j].y > a[i].y)
          st |= 2;
      } else if (a[j].y == a[i].y) {
        if (a[j].x < a[i].x)
          st |= 4;
        else if (a[j].x > a[i].x)
          st |= 8;
      }
    ans += (st == 15);
  }
  printf("%d", ans);
  return 0;
}
