#include <bits/stdc++.h>
using namespace std;
long long int fact(long long int f) {
  if (f == 1) {
    return 1;
  } else {
    return f + fact(f - 1);
  }
}
int main() {
  map<long long int, long long int> X;
  map<long long int, long long int> Y;
  map<long long int, long long int> Z;
  long long int num;
  long long int total = 0;
  long long int x;
  long long int y;
  long long int z;
  long long int a;
  cin >> num;
  for (int i = 0; i < num; i++) {
    for (int i2 = 0; i2 < 2; i2++) {
      if (i2 == 0) {
        cin >> x;
      } else {
        cin >> y;
      }
    }
    X[x] += 1;
    Y[y] += 1;
    z = x + 200000 * y;
    Z[z] += 1;
    if (Z[z] > 1) {
      total -= Z[z] - 1;
    }
  }
  for (map<long long int, long long int>::iterator i11 = X.begin();
       i11 != X.end(); ++i11) {
    if (i11->second > 1) {
      total += fact(i11->second - 1);
    }
  }
  for (map<long long int, long long int>::iterator i22 = Y.begin();
       i22 != Y.end(); ++i22) {
    if (i22->second > 1) {
      total += fact(i22->second - 1);
    }
  }
  cout << total;
  return 0;
}
