#include <bits/stdc++.h>
using namespace std;
const int maxn = 10010;
int visx[1010];
int visxf[1010];
int visy[1010];
int visyf[1010];
struct Node {
  int x, y;
} A[210];
int main() {
  int i, j, k, n;
  scanf("%d", &n);
  for (i = 0; i < n; ++i) {
    scanf("%d%d", &A[i].x, &A[i].y);
  }
  int ans = 0;
  for (i = 0; i < n; ++i) {
    bool sign1 = false, sign2 = false, sign3 = false, sign4 = false;
    for (j = 0; j < n; ++j) {
      if (j == i) continue;
      if (A[j].y == A[i].y && A[j].x > A[i].x) sign1 = true;
      if (A[j].y == A[i].y && A[j].x < A[i].x) sign2 = true;
      if (A[j].x == A[i].x && A[j].y > A[i].y) sign3 = true;
      if (A[j].x == A[i].x && A[j].y < A[i].y) sign4 = true;
    }
    if (sign1 && sign2 && sign3 && sign4) ans++;
  }
  printf("%d\n", ans);
  return 0;
}
