#include <bits/stdc++.h>
using namespace std;
map<long long, long long> xs, ys;
map<pair<long long, long long>, long long> fl;
int main() {
  long long n;
  cin >> n;
  long long ans = 0;
  for (long long i = 0; i < n; i++) {
    long long X, Y;
    cin >> X >> Y;
    xs[X]++;
    ys[Y]++;
    fl[make_pair(X, Y)]++;
  }
  for (map<long long, long long>::iterator it = xs.begin(); it != xs.end();
       it++) {
    long long add = (it->second) * (it->second - 1) / 2;
    ans += add;
  }
  for (map<long long, long long>::iterator it = ys.begin(); it != ys.end();
       it++) {
    long long add = (it->second) * (it->second - 1) / 2;
    ans += add;
  }
  for (map<pair<long long, long long>, long long>::iterator it = fl.begin();
       it != fl.end(); it++) {
    long long add = (it->second) * (it->second - 1) / 2;
    ans -= add;
  }
  cout << ans;
  return 0;
}
