#include <bits/stdc++.h>
using namespace std;
long long n, ans = 0, c = 0;
map<int, int> mpx, mpy;
map<pair<int, int>, int> mp;
int main() {
  cin >> n;
  for (int i = 0, t1, t2; i < n; i++) {
    scanf("%d%d", &t1, &t2);
    pair<int, int> p(t1, t2);
    mpx[t1]++;
    mpy[t2]++;
    if (mp.find(p) != mp.end()) c += mp[p];
    mp[p]++;
  }
  for (auto el : mpx) {
    ans += ((long long)el.second * (el.second - 1)) / 2;
  }
  for (auto el : mpy) {
    ans += ((long long)el.second * (el.second - 1)) / 2;
  }
  ans -= c;
  cout << ans;
  return 0;
}
