#include <bits/stdc++.h>
using namespace std;
int main(void) {
  ios_base::sync_with_stdio(0);
  long long a, n, b, c, d, e, f;
  long long abc[200005];
  cin >> n;
  map<long long, long long> x, y;
  map<pair<long long, long long>, long long> xy;
  while (n--) {
    cin >> a >> b;
    x[a]++;
    y[b]++;
    xy[make_pair(a, b)]++;
  }
  long long ans = 0;
  map<long long, long long>::iterator it1, it2;
  map<pair<long long, long long>, long long>::iterator it3;
  for (it1 = x.begin(); it1 != x.end(); ++it1) {
    long long te = it1->second;
    ans += (te * (te - 1)) / 2;
  }
  for (it2 = y.begin(); it2 != y.end(); ++it2) {
    ans += (it2->second * (it2->second - 1)) / 2;
  }
  for (it3 = xy.begin(); it3 != xy.end(); ++it3) {
    ans -= (it3->second * (it3->second - 1)) / 2;
  }
  cout << ans;
  return 0;
}
