#include <bits/stdc++.h>
using namespace std;
pair<long long, long long> p;
map<long long, long long> mp1, mp2;
map<pair<long long, long long>, long long> mp;
int main(void) {
  long long a, b, c, sum = 0;
  scanf("%lld", &a);
  while (a--) {
    scanf("%lld %lld", &b, &c);
    p.first = b;
    p.second = c;
    mp1[b]++;
    mp2[c]++;
    mp[p]++;
  }
  map<long long, long long>::iterator iter;
  for (iter = mp1.begin(); iter != mp1.end(); iter++) {
    sum += iter->second * (iter->second - 1) / 2;
  }
  for (iter = mp2.begin(); iter != mp2.end(); iter++) {
    sum += iter->second * (iter->second - 1) / 2;
  }
  map<pair<long long, long long>, long long>::iterator ite;
  for (ite = mp.begin(); ite != mp.end(); ite++) {
    sum -= ite->second * (ite->second - 1) / 2;
  }
  printf("%lld\n", sum);
  return 0;
}
