#include <bits/stdc++.h>
using namespace std;
pair<int, int> w[200005];
int main() {
  long long ans = 0ll;
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%d%d", &w[i].first, &w[i].second);
  }
  sort(w, w + n);
  int cnt = 0;
  int cnt2 = 0;
  for (int i = 1; i < n; i++) {
    cnt++;
    if (w[i].first != w[i - 1].first) {
      if (cnt != 1) {
        ans += (long long)(cnt - 1ll) * (cnt) / 2ll;
      }
      cnt = 0;
    }
    cnt2++;
    if (w[i].first != w[i - 1].first || w[i].second != w[i - 1].second) {
      if (cnt2 != 1) {
        ans -= (long long)(cnt2 - 1ll) * (cnt2) / 2ll;
      }
      cnt2 = 0;
    }
  }
  cnt++;
  if (cnt != 1) {
    ans += (long long)(cnt - 1ll) * (cnt) / 2ll;
  }
  cnt2++;
  if (cnt2 != 1) {
    ans -= (long long)(cnt2 - 1ll) * (cnt2) / 2ll;
  }
  for (int i = 0; i < n; i++) {
    cnt = w[i].first;
    w[i].first = w[i].second;
    w[i].second = cnt;
  }
  cnt = 0;
  sort(w, w + n);
  for (int i = 1; i < n; i++) {
    cnt++;
    if (w[i].first != w[i - 1].first) {
      if (cnt != 1) {
        ans += (long long)(cnt - 1ll) * (cnt) / 2ll;
      }
      cnt = 0;
    }
  }
  cnt++;
  if (cnt != 1) {
    ans += (long long)(cnt - 1ll) * (cnt) / 2ll;
  }
  printf("%I64d", ans);
}
