#include <bits/stdc++.h>
using namespace std;
void fill_set(set<int> &st, int n) {
  for (int i = 1; i <= n; ++i) st.insert(i);
}
void ans(int n, int k) {
  set<int> st;
  fill_set(st, n);
  if (k == 0) {
    for (auto x : st) cout << x << " ";
    cout << "\n";
  } else {
    cout << 2 << " " << 3 << " " << 1 << " ";
    st.erase(2);
    st.erase(3);
    st.erase(1);
    int end = 1;
    k -= 1;
    while (k > 0 && !st.empty()) {
      auto it = st.upper_bound(end);
      if (it == st.end()) break;
      auto x = it;
      x++;
      cout << *x << " " << *it << " ";
      st.erase(x);
      st.erase(it);
      k--;
    }
    for (auto x : st) cout << x << " ";
    cout << "\n";
  }
}
int main() {
  int n;
  cin >> n;
  vector<pair<int, int>> v(n);
  for (int i = 0; i < n; ++i) {
    cin >> v[i].first >> v[i].second;
  }
  int count{};
  for (int i = 0; i < n; ++i) {
    int low{}, high{}, right{}, left{};
    for (int j = 0; j < n; ++j) {
      if (j != i) {
        if (v[i].second == v[j].second) {
          if (v[i].first < v[j].first)
            right++;
          else if (v[i].first > v[j].first)
            left++;
        }
        if (v[i].first == v[j].first) {
          if (v[i].second > v[j].second)
            high++;
          else if (v[i].second < v[j].second)
            low++;
        }
      }
    }
    if (low > 0 && high > 0 && left > 0 && right > 0) count++;
  }
  cout << count << "\n";
}
