#include <bits/stdc++.h>
using namespace std;
int main() {
  long long x, xx, yy, n, tr = 0, rx = 0, ry = 0;
  cin >> n;
  map<long long, long long> mx, my;
  map<pair<long long, long long>, long long> tp;
  for (long long i = 0; i < n; i++) {
    cin >> xx >> yy;
    mx[xx]++;
    my[yy]++;
    tp[{xx, yy}]++;
  }
  for (auto& mm : mx) {
    x = mm.second;
    rx += x * (x - 1) / 2;
  }
  for (auto& mm : my) {
    x = mm.second;
    ry += x * (x - 1) / 2;
  }
  for (auto& mm : tp) {
    x = mm.second;
    tr += x * (x - 1) / 2;
  }
  cout << ry + rx - tr;
  return 0;
}
