#include <bits/stdc++.h>
using namespace std;
map<int, int> mx, my;
map<pair<int, int>, int> mxy;
int main() {
  int n, x, y;
  long long c = 0;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> x >> y;
    mx[x]++;
    my[y]++;
    mxy[make_pair(x, y)]++;
  }
  map<int, int>::iterator i;
  for (i = mx.begin(); i != mx.end(); i++) {
    c += ((long long)i->second * (i->second - 1) / 2);
  }
  for (i = my.begin(); i != my.end(); i++) {
    c += ((long long)i->second * (i->second - 1) / 2);
  }
  map<pair<int, int>, int>::iterator ii;
  for (ii = mxy.begin(); ii != mxy.end(); ii++) {
    c -= ((long long)ii->second * (ii->second - 1) / 2);
  }
  cout << c;
  return 0;
}
