#include <bits/stdc++.h>
using namespace std;
int main() {
  cin.tie(NULL);
  cout.tie(NULL);
  int n, t;
  scanf("%d", &n);
  map<long long int, int> mpx, mpy;
  map<pair<long long int, long long int>, int> mp;
  long long int x[n + 5], y[n + 5];
  for (int i = 0; i < n; i++) {
    scanf("%lld%lld", &x[i], &y[i]);
    mpx[x[i]]++;
    mpy[y[i]]++;
    mp[make_pair(x[i], y[i])]++;
  }
  long long int cnt = 0, cnty = 0;
  for (map<long long int, int>::iterator it = mpx.begin(); it != mpx.end();
       it++) {
    if ((*it).second > 1) {
      long long int os = ((*it).second);
      cnt += (os * (os - 1) / 2);
    }
  }
  for (map<long long int, int>::iterator it = mpy.begin(); it != mpy.end();
       it++) {
    if ((*it).second > 1) {
      long long int os = ((*it).second);
      cnt += (os * (os - 1) / 2);
    }
  }
  for (map<pair<long long int, long long int>, int>::iterator it = mp.begin();
       it != mp.end(); it++) {
    if ((*it).second > 1) {
      long long int os = ((*it).second);
      cnt -= (os * (os - 1) / 2);
    }
  }
  printf("%lld\n", cnt);
  return 0;
}
