#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n;
  cin >> n;
  vector<pair<long long, long long> > V;
  V.resize(n);
  map<long long, long long> mp1;
  map<long long, long long>::iterator it1;
  map<long long, long long> mp2;
  map<long long, long long>::iterator it2;
  map<pair<long long, long long>, long long> same;
  map<pair<long long, long long>, long long>::iterator it3;
  for (long long i = 0; i < n; i++) {
    cin >> V[i].first >> V[i].second;
    if (mp1.count(V[i].first))
      mp1[V[i].first]++;
    else
      mp1[V[i].first] = 1;
    if (mp2.count(V[i].second))
      mp2[V[i].second]++;
    else
      mp2[V[i].second] = 1;
    if (same.count(make_pair(V[i].first, V[i].second))) {
      same[make_pair(V[i].first, V[i].second)]++;
    } else
      same[make_pair(V[i].first, V[i].second)] = 1;
  }
  long long ans = 0;
  for (auto& x : mp1) {
    long long xx = x.second;
    ans += (xx * (xx - 1)) / 2;
  }
  for (auto& x : mp2) {
    long long xx = x.second;
    ans += (xx * (xx - 1)) / 2;
  }
  for (auto& x : same) {
    long long xx = x.second;
    ans -= (xx * (xx - 1)) / 2;
  }
  cout << ans << endl;
  return 0;
}
