#include <bits/stdc++.h>
using namespace std;
const double pi = 3.1415926535897;
const int MAX = 1000;
int stoi1(string op) {
  int i;
  stringstream s_str(op);
  s_str >> i;
  return i;
}
string to_stringe(int number) {
  stringstream ss;
  ss << number;
  return ss.str();
}
int dp_fib[1001];
int fact_memoization(int n) {
  if (n <= 1) return 1;
  if (dp_fib[n] != -1) return dp_fib[n];
  return dp_fib[n] = fact_memoization(n - 2) + fact_memoization(n - 1);
}
int fact_bottomUp_dp(int n) {
  int arr[1000001];
  arr[0] = arr[1] = 1;
  for (int i = 2; i <= n; i++) arr[i] = arr[i - 2] + arr[i - 1];
  return arr[n];
}
int move_count(int *a, int n) {
  int j = n - 1;
  while (j > 0 && a[j - 1] < a[j]) --j;
  if (j == 0) return 0;
  int min_val = a[j], v_1 = a[j - 1];
  j -= 2;
  while (j >= 0) {
    if (a[j] < min_val) {
      min_val = a[j];
    } else if (a[j] < v_1) {
      v_1 = a[j];
    }
    --j;
  }
  int count_smaller = 0;
  for (j = 0; j < n; ++j) {
    if (a[j] < v_1) ++count_smaller;
  }
  return n - count_smaller;
}
int n;
bool valid(int a, int b) {
  if ((a < 0 || b < 0) || (a >= n || b >= n)) return false;
  return true;
}
int grid[MAX][MAX];
int MEM[MAX][MAX];
int max_path(int y, int s) {
  if (!valid(y, s)) return 0;
  if (MEM[y][s] != -1) return MEM[y][s];
  if (y == n - 1 && s == n - 1) return grid[y][s];
  int path1 = max_path(y + 1, s);
  int path2 = max_path(y, s + 1);
  return MEM[y][s] = grid[y][s] + max(path1, path2);
}
int r[MAX], g[MAX], b[MAX];
int dp[MAX][4];
int minCost(int i, int lastColor) {
  if (i == n) return 0;
  int &ret = dp[i][lastColor];
  if (ret != -1) return ret;
  ret = (int)1 << 29;
  if (lastColor != 0) ret = min(ret, r[i] + minCost(i + 1, 0));
  if (lastColor != 1) ret = min(ret, g[i] + minCost(i + 1, 1));
  if (lastColor != 2) ret = min(ret, b[i] + minCost(i + 1, 2));
  return ret;
}
int main() {
  int N;
  cin >> N;
  vector<pair<int, int> > vec;
  for (int i = 0; i < N; i++) {
    int x, y;
    cin >> x >> y;
    vec.push_back(make_pair(x, y));
  }
  int ans = 0;
  for (int i = 0; i < N; i++) {
    int UpY = 0, DnY = 0, LX = 0, RX = 0;
    int searchX = vec[i].first;
    int searchY = vec[i].second;
    for (int i2 = 0; i2 < N; i2++) {
      if (i2 == i) continue;
      if (vec[i2].first == searchX) {
        if (vec[i2].second > searchY)
          UpY++;
        else
          DnY++;
      }
      if (vec[i2].second == searchY) {
        if (vec[i2].first > searchX)
          RX++;
        else
          LX++;
      }
    }
    if ((UpY > 0) && (DnY > 0) && (LX > 0) && (RX > 0)) {
      ans++;
    }
  }
  cout << ans << endl;
  return 0;
}
