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