#include <bits/stdc++.h>
using namespace std;
map<pair<long long, long long>, long long> XY;
map<long long, long long> X;
map<long long, long long> Y;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long n;
  cin >> n;
  long long x, y;
  for (long long i = 0; i < n; i++) {
    cin >> x >> y;
    if (X.count(x) > 0) {
      X[x] = X[x] + 1;
    } else {
      X[x] = 1;
    }
    if (Y.count(y) > 0) {
      Y[y] = Y[y] + 1;
    } else {
      Y[y] = 1;
    }
    pair<long long, long long> punkt = make_pair(x, y);
    if (XY.count(punkt) > 0) {
      XY[punkt] = XY[punkt] + 1;
    } else {
      XY[punkt] = 1;
    }
  }
  long long wynik = 0;
  for (map<long long, long long>::iterator it = X.begin(); it != X.end();
       it++) {
    long long val = it->second;
    wynik += (val * (val - 1)) / 2;
  }
  for (map<long long, long long>::iterator it = Y.begin(); it != Y.end();
       it++) {
    long long val = it->second;
    wynik += (val * (val - 1)) / 2;
  }
  for (map<pair<long long, long long>, long long>::iterator it = XY.begin();
       it != XY.end(); it++) {
    long long val = it->second;
    wynik -= (val * (val - 1)) / 2;
  }
  cout << wynik << '\n';
  return 0;
}
