#include <bits/stdc++.h>
using namespace std;
map<int, long long> mp;
map<int, long long> mmp;
map<pair<int, int>, long long> mmmp;
long long cnt = 0;
int main() {
  ios_base::sync_with_stdio(0);
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    int x, y;
    cin >> x >> y;
    if (mmmp[make_pair(x, y)] >= 1) {
      mmmp[make_pair(x, y)]++;
      mp[x]++;
      mmp[y]++;
    } else {
      mmmp[make_pair(x, y)]++;
      mp[x]++;
      mmp[y]++;
    }
  }
  for (map<int, long long>::iterator it = mp.begin(); it != mp.end(); it++) {
    long long add = (*it).second;
    cnt += add * (add - 1) / 2;
  }
  for (map<int, long long>::iterator it = mmp.begin(); it != mmp.end(); it++) {
    long long add = (*it).second;
    cnt += add * (add - 1) / 2;
  }
  for (map<pair<int, int>, long long>::iterator it = mmmp.begin();
       it != mmmp.end(); it++) {
    long long add = (*it).second;
    cnt -= add * (add - 1) / 2;
  }
  cout << cnt << "\n";
  return 0;
}
