#include <bits/stdc++.h>
using namespace std;
bool DBG = false;
int main() {
  ios_base::sync_with_stdio(false);
  int n;
  cin >> n;
  map<int, int> mx;
  map<int, int> my;
  map<pair<int, int>, int> pm;
  for (int i = 0; i < (int)(n); ++i) {
    pair<int, int> p;
    cin >> p.first >> p.second;
    mx[p.first]++;
    my[p.second]++;
    pm[p]++;
  }
  long long res = 0;
  for (const auto& xitem : mx) {
    res += xitem.second * 1LL * (xitem.second - 1) / 2;
  }
  for (const auto& yitem : my) {
    res += yitem.second * 1LL * (yitem.second - 1) / 2;
  }
  for (const auto& pitem : pm) {
    if (pitem.second > 1) {
      res = res - pitem.second * 1LL * (pitem.second - 1) / 2;
    }
  }
  cout << res << endl;
  return 0;
}
