#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  long int n;
  cin >> n;
  map<pair<long int, long int>, long int> mapp1;
  map<long int, long int> mappx, mappy;
  for (long int i = 0; i < n; ++i) {
    long int x, y;
    cin >> x >> y;
    mappx[x]++;
    mappy[y]++;
    mapp1[make_pair(x, y)]++;
  }
  long long int ans = 0;
  for (auto i = mapp1.begin(); i != mapp1.end(); ++i) {
    ans -= (long long int)(i->second) * (i->second - 1) / 2;
  }
  for (auto i = mappx.begin(); i != mappx.end(); ++i) {
    ans += (long long int)(i->second) * (i->second - 1) / 2;
  }
  for (auto i = mappy.begin(); i != mappy.end(); ++i) {
    ans += (long long int)(i->second) * (i->second - 1) / 2;
  }
  cout << ans;
  return 0;
}
