#include <bits/stdc++.h>
using namespace std;
struct point {
  point() { h = v = 0; }
  int x, y;
  bool h, v;
};
int main() {
  int n, sup = 0;
  cin >> n;
  vector<point> p(n);
  for (int i = 0; i < n; i++) {
    cin >> p[i].x >> p[i].y;
  }
  for (int i = 0; i < n; i++)
    for (int j = n - 2; j >= i; j--)
      if (p[j].x > p[j + 1].x) {
        point temp = p[j + 1];
        p[j + 1] = p[j];
        p[j] = temp;
      }
  for (int i = 0; i < n;) {
    int j, max = -2000, min = 2000;
    for (j = i; p[j].x == p[i].x; j++) {
      if (max < p[j].y) max = p[j].y;
      if (min > p[j].y) min = p[j].y;
    }
    for (j = i; p[j].x == p[i].x; j++) {
      if (p[j].y > min && p[j].y < max) {
        p[j].v = 1;
      }
    }
    i = j;
  }
  for (int i = 0; i < n; i++)
    for (int j = n - 2; j >= i; j--)
      if (p[j].y > p[j + 1].y) {
        point temp = p[j + 1];
        p[j + 1] = p[j];
        p[j] = temp;
      }
  for (int i = 0; i < n;) {
    int j, max = -2000, min = 2000;
    for (j = i; p[j].y == p[i].y; j++) {
      if (max < p[j].x) max = p[j].x;
      if (min > p[j].x) min = p[j].x;
    }
    for (j = i; p[j].y == p[i].y; j++) {
      if (p[j].x > min && p[j].x < max) {
        p[j].h = 1;
      }
    }
    i = j;
  }
  for (int i = 0; i < n; i++)
    if (p[i].h && p[i].v) sup++;
  cout << sup;
}
