#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, x, y, k = 0, l = 0, s = 0, t, r = 0, v, u;
  map<int, int> m1;
  map<int, int> m2;
  multimap<int, int> m3;
  map<pair<int, int>, int> m4;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> x >> y;
    if (m1.count(x) && m2.count(y)) {
      k = k + m1[x] + m2[y];
    } else if (!m1.count(x) && m2.count(y)) {
      l = l + m2[y];
    } else if (m1.count(x) && !m2.count(y)) {
      s = s + m1[x];
    }
    m1[x] = m1[x] + 1;
    m2[y] = m2[y] + 1;
    m3.insert(pair<int, int>(x, y));
  }
  for (multimap<int, int>::iterator it = m3.begin(); it != m3.end(); ++it) {
    u = (*it).first;
    v = (*it).second;
    if (m4[make_pair(u, v)]) {
      r = r + m4[make_pair(u, v)];
    }
    m4[make_pair(u, v)] = m4[make_pair(u, v)] + 1;
  }
  t = k + l + s - r;
  cout << t << endl;
  return 0;
}
