#include <bits/stdc++.h>
using namespace std;
map<int, long long> x, y;
map<pair<int, int>, long long> s;
int main() {
  int n;
  cin >> n;
  ;
  int same = 0;
  for (int i(0); i < n; i++) {
    int a;
    cin >> a;
    int b;
    cin >> b;
    ;
    if (s.count({a, b}))
      s[{a, b}]++;
    else
      s[{a, b}] = 1;
    if (!x.count(a))
      x[a] = 1;
    else
      x[a]++;
    if (!y.count(b))
      y[b] = 1;
    else
      y[b]++;
  }
  long long res = 0;
  for (auto i : x) {
    res += ((i.second) * (i.second - 1)) / 2;
  }
  for (auto i : y) {
    res += ((i.second) * (i.second - 1)) / 2;
  }
  for (auto i : s) {
    res -= ((i.second) * (i.second - 1)) / 2;
  }
  res -= same;
  cout << res << endl;
  return 0;
}
