#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  map<int, int> x, y;
  map<pair<int, int>, int> m;
  scanf("%d", &n);
  while (n--) {
    int a, b;
    scanf("%d%d", &a, &b);
    ++x[a];
    ++y[b];
    ++m[make_pair(a, b)];
  }
  long long ans = 0;
  for (auto& it : x) {
    ans += (long long)(it.second) * (long long)(it.second - 1) / 2;
  }
  for (auto& it : y) {
    ans += (long long)(it.second) * (long long)(it.second - 1) / 2;
  }
  for (auto& it : m) {
    ans -= (long long)(it.second) * (long long)(it.second - 1) / 2;
  }
  cout << ans << "\n";
}
