#include <bits/stdc++.h>
using namespace std;
map<int, int> xmap, ymap;
map<pair<int, int>, int> xymap;
int main() {
  int n, x, y;
  long long ans = 0;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%d%d", &x, &y);
    xmap[x]++;
    ymap[y]++;
    xymap[make_pair(x, y)]++;
  }
  for (auto v : xmap) {
    long long num = v.second;
    ans += num * (num - 1) / 2;
  }
  for (auto v : ymap) {
    long long num = v.second;
    ans += num * (num - 1) / 2;
  }
  for (auto v : xymap) {
    long long num = v.second;
    ans -= num * (num - 1) / 2;
  }
  printf("%I64d\n", ans);
}
