#include <bits/stdc++.h>
using namespace std;
map<long long int, long long int> edgex;
map<long long int, long long int> edgey;
map<pair<long long int, long long int>, long long int> points;
int main() {
  long long int n;
  cin >> n;
  long long re = 0;
  for (long long int i = 0; i < n; i++) {
    long long int x, y;
    cin >> x >> y;
    edgex[x]++;
    edgey[y]++;
    points[make_pair(x, y)]++;
  }
  map<long long int, long long int>::iterator itx = edgex.begin();
  map<long long int, long long int>::iterator ity = edgey.begin();
  map<pair<long long int, long long int>, long long int>::iterator itp =
      points.begin();
  long long int ans = 0;
  for (; itx != edgex.end(); ++itx) {
    long long int val = itx->second;
    ans += (val * (val - 1)) / 2;
  }
  for (; ity != edgey.end(); ++ity) {
    long long int val = ity->second;
    ans += (val * (val - 1)) / 2;
  }
  for (; itp != points.end(); ++itp) {
    long long int sobra = (itp->second);
    re += (sobra * (sobra - 1)) / 2;
  }
  ans -= re;
  cout << ans << endl;
  return 0;
}
