#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n;
  cin >> n;
  long long ans = 0;
  map<pair<long long, long long>, long long> mp;
  map<long long, long long> mpx1;
  map<long long, long long> mpx2;
  for (int i = 0; i < n; i++) {
    long long a, b;
    cin >> a >> b;
    mp[{a, b}]++;
    mpx1[a]++;
    mpx2[b]++;
  }
  long long cnt = 0;
  map<pair<long long, long long>, long long>::iterator it;
  map<long long, long long>::iterator it1;
  for (it1 = mpx1.begin(); it1 != mpx1.end(); ++it1)
    ans += it1->second * (it1->second - 1) / 2;
  for (it1 = mpx2.begin(); it1 != mpx2.end(); ++it1)
    ans += it1->second * (it1->second - 1) / 2;
  for (it = mp.begin(); it != mp.end(); ++it) {
    ans -= it->second * (it->second - 1) / 2;
  }
  cout << ans;
  return 0;
}
