#include <bits/stdc++.h>
using namespace std;
int main() {
  long long i, j, k, l, n, m, t;
  map<long long, long long> x;
  map<long long, long long> y;
  map<pair<long long, long long>, long long> xy;
  cin >> n;
  for (i = 0; i < n; i++) {
    cin >> j >> k;
    if (x.find(j) == x.end()) {
      x.insert(make_pair(j, 1));
    } else {
      x[j]++;
    }
    if (y.find(k) == y.end()) {
      y.insert(make_pair(k, 1));
    } else {
      y[k]++;
    }
    if (xy.find(make_pair(j, k)) == xy.end()) {
      xy.insert(make_pair(make_pair(j, k), 1));
    } else {
      xy[make_pair(j, k)]++;
    }
  }
  t = 0;
  for (map<long long, long long>::iterator itr = x.begin(); itr != x.end();
       itr++) {
    k = itr->second;
    t = t + k * (k - 1) / 2;
  }
  for (map<long long, long long>::iterator itr = y.begin(); itr != y.end();
       itr++) {
    k = itr->second;
    t = t + k * (k - 1) / 2;
  }
  for (map<pair<long long, long long>, long long>::iterator itr = xy.begin();
       itr != xy.end(); itr++) {
    k = itr->second;
    t = t - k * (k - 1) / 2;
  }
  cout << t << endl;
  return 0;
}
