#include <bits/stdc++.h>
using namespace std;
template <class T>
long long cnt(vector<T>& v) {
  long long res = 0;
  long long tmp = 1;
  for (int i = 1; i < v.size(); i++) {
    if (v[i] == v[i - 1]) {
      tmp++;
    } else {
      res += tmp * (tmp - 1) / 2;
      tmp = 1;
    }
  }
  res += tmp * (tmp - 1) / 2;
  return res;
}
int main() {
  vector<pair<long long, long long> > v;
  vector<long long> a, b;
  int n;
  cin >> n;
  v.resize(n);
  a.resize(n);
  b.resize(n);
  for (int i = 0; i < v.size(); i++) {
    cin >> v[i].first >> v[i].second;
    a[i] = v[i].first;
    b[i] = v[i].second;
  }
  sort((v).begin(), (v).end());
  sort((a).begin(), (a).end());
  sort((b).begin(), (b).end());
  cout << cnt(a) + cnt(b) - cnt(v) << endl;
}
