#include <bits/stdc++.h>
using namespace std;
long long int modpow(long long int a, long long int n, long long int temp) {
  long long int res = 1, y = a;
  while (n > 0) {
    if (n & 1) res = (res * y) % temp;
    y = (y * y) % temp;
    n /= 2;
  }
  return res % temp;
}
map<long long int, long long int> X;
map<long long int, long long int> Y;
map<pair<long long int, long long int>, long long int> present;
int main() {
  long long int t, l, r, i, j, xi, yi;
  cin >> t;
  long long int c = 0;
  while (t--) {
    cin >> xi >> yi;
    X[xi]++;
    Y[yi]++;
    present[make_pair(xi, yi)]++;
  }
  map<long long int, long long int>::iterator itx;
  itx = X.begin();
  long long int ans = 0;
  while (itx != X.end()) {
    ans += (itx->second * (itx->second - 1)) / 2;
    itx++;
  }
  itx = Y.begin();
  while (itx != Y.end()) {
    ans += (itx->second * (itx->second - 1)) / 2;
    itx++;
  }
  map<pair<long long int, long long int>, long long int>::iterator it;
  it = present.begin();
  while (it != present.end()) {
    ans -= ((it->second) * (it->second - 1)) / 2;
    it++;
  }
  cout << ans << endl;
  return 0;
}
