#include <bits/stdc++.h>
using namespace std;
map<int, int> mapx;
map<int, int> mapy;
map<pair<int, int>, int> mappair;
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    int x, y;
    scanf("%d %d", &x, &y);
    mapx[x]++;
    mapy[y]++;
    mappair[make_pair(x, y)]++;
  }
  long long countx = 0;
  for (map<int, int>::iterator it = mapx.begin(); it != mapx.end(); it++) {
    long long tmp = it->second;
    if (tmp > 1) {
      countx += (tmp * (tmp - 1) / 2);
    }
  }
  long long county = 0;
  for (map<int, int>::iterator it = mapy.begin(); it != mapy.end(); it++) {
    long long tmp = it->second;
    if (tmp > 1) {
      county += (tmp * (tmp - 1) / 2);
    }
  }
  long long countpair = 0;
  for (map<pair<int, int>, int>::iterator it = mappair.begin();
       it != mappair.end(); it++) {
    long long tmp = it->second;
    if (tmp > 1) {
      countpair += (tmp * (tmp - 1) / 2);
    }
  }
  printf("%I64d\n", countx + county - countpair);
  return 0;
}
