#include <bits/stdc++.h>
using namespace std;
int visited[200010];
int main() {
  map<long long, int> x;
  map<long long, int> y;
  map<long long, std::map<long long, int> > name;
  long long p, q;
  int i, j, k, l, m, n;
  long long cou = 0;
  scanf("%d", &n);
  for (i = 1; i <= n; i++) {
    scanf("%I64d%I64d", &p, &q);
    cou = cou + x[p] + y[q] - name[p][q];
    x[p]++;
    y[q]++;
    name[p][q]++;
  }
  printf("%I64d", cou);
}
