#include <bits/stdc++.h>
using namespace std;
using lli = long long int;
int main() {
  int n;
  cin >> n;
  map<pair<int, int>, int> counter;
  map<lli, lli> x;
  map<lli, lli> y;
  for (int i = 0; i < n; i++) {
    int a, b;
    cin >> a >> b;
    counter[{a, b}]++;
    x[a]++;
    y[b]++;
  }
  lli res = 0;
  for (auto it = x.begin(); it != x.end(); it++) {
    lli freq = (*it).second;
    res += freq * (freq - 1) / 2;
  }
  for (auto it = y.begin(); it != y.end(); it++) {
    lli freq = (*it).second;
    res += freq * (freq - 1) / 2;
  }
  for (auto it = counter.begin(); it != counter.end(); it++) {
    lli freq = (*it).second;
    res -= freq * (freq - 1) / 2;
  }
  cout << res << endl;
  return 0;
}
