#include <bits/stdc++.h>
using namespace std;
const int maxn = 200000 + 5;
struct node {
  int x, y;
} a[maxn];
int cmp1(node p, node q) {
  if (p.x == q.x) return p.y < q.y;
  return p.x < q.x;
}
int cmp2(node p, node q) {
  if (p.y == q.y) return p.x < q.x;
  return p.y < q.y;
}
int main() {
  int n;
  while (scanf("%d", &n) != EOF) {
    for (int i = 0; i < n; i++) scanf("%d%d", &a[i].x, &a[i].y);
    long long ans = 0;
    sort(a, a + n, cmp1);
    long long temp;
    for (int i = 0; i < n; i++) {
      int j = i + 1;
      temp = 1;
      while (a[j].x == a[i].x && j < n) {
        temp++;
        j++;
      }
      i = j - 1;
      ans += temp * (temp - 1) / 2;
    }
    sort(a, a + n, cmp2);
    for (int i = 0; i < n; i++) {
      int j = i + 1;
      temp = 1;
      while (a[j].y == a[i].y && j < n) {
        temp++;
        j++;
      }
      i = j - 1;
      ans += temp * (temp - 1) / 2;
    }
    for (int i = 0; i < n; i++) {
      int j = i + 1;
      ;
      temp = 1;
      while (a[j].y == a[i].y && a[j].x == a[i].x && j < n) {
        temp++;
        j++;
      }
      i = j - 1;
      ans -= temp * (temp - 1) / 2;
    }
    printf("%I64d\n", ans);
  }
  return 0;
}
