#include <bits/stdc++.h>
using namespace std;
signed main() {
  long long n, a, b, ans = 0;
  cin >> n;
  unordered_map<long long, long long> xM, yM;
  map<pair<long long, long long>, long long> xyM;
  while (n--) {
    cin >> a >> b;
    xM[a]++;
    yM[b]++;
    xyM[{a, b}]++;
  }
  for (auto &x : xM) {
    long long i = x.second;
    ans += i * (i - 1) / 2;
  }
  for (auto &y : yM) {
    long long j = y.second;
    ans += j * (j - 1) / 2;
  }
  for (auto &xy : xyM) {
    long long ij = xy.second;
    ans -= ij * (ij - 1) / 2;
  }
  cout << ans;
  return 0;
}
