#include <bits/stdc++.h>
using namespace std;
bool comp(const pair<int, int> &a, const pair<int, int> &b) {
  return a.second < b.second;
}
int main(int argc, char const *argv[]) {
  int n, i, x, y;
  cin >> n;
  vector<pair<int, int> > a;
  a.reserve(n);
  for (int i = 0; i < n; ++i) {
    cin >> x >> y;
    a.push_back(make_pair(x, y));
  }
  vector<pair<int, int> >::iterator it;
  sort(a.begin(), a.end());
  long long int count = 1, ans = 0;
  for (i = 1; i != n; ++i) {
    if (a[i].first == a[i - 1].first)
      count++;
    else {
      ans = ans + (count * (count - 1)) / 2;
      count = 1;
    }
  }
  ans = ans + (count * (count - 1)) / 2;
  count = 1;
  for (i = 1; i != n; ++i) {
    if (a[i].first == a[i - 1].first && a[i].second == a[i - 1].second)
      count++;
    else {
      ans = ans - (count * (count - 1)) / 2;
      count = 1;
    }
  }
  ans = ans - (count * (count - 1)) / 2;
  count = 1;
  sort(a.begin(), a.end(), comp);
  for (i = 1; i != n; ++i) {
    if (a[i].second == a[i - 1].second)
      count++;
    else {
      ans = ans + (count * (count - 1)) / 2;
      count = 1;
    }
  }
  ans = ans + (count * (count - 1)) / 2;
  cout << ans << endl;
  return 0;
}
