#include <bits/stdc++.h>
using namespace std;
const int mn = 2 * 1e5 + 10;
struct node {
  int x, y;
} a[mn];
bool cmp1(node A, node B) { return A.x < B.x; }
bool cmp2(node A, node B) { return A.y < B.y || A.y == B.y && A.x < B.x; }
int n;
long long ans = 0;
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i) {
    scanf("%d%d", &a[i].x, &a[i].y);
  }
  sort(a + 1, a + 1 + n, cmp1);
  for (int i = 1; i <= n; ++i) {
    if (a[i].x == a[i + 1].x) {
      int j = i + 1;
      while (a[i].x == a[j].x && j <= n) ++j;
      ans += (long long)(j - i) * (j - i - 1) / 2;
      i = j - 1;
    }
  }
  sort(a + 1, a + 1 + n, cmp2);
  for (int i = 1; i <= n; ++i) {
    if (a[i].y == a[i + 1].y) {
      int j = i + 1;
      while (a[i].y == a[j].y && j <= n) ++j;
      ans += (long long)(j - i) * (j - i - 1) / 2;
      i = j - 1;
    }
  }
  for (int i = 1; i <= n; ++i) {
    if (a[i].x == a[i + 1].x && a[i].y == a[i + 1].y) {
      int j = i + 1;
      while (a[i].x == a[j].x && a[i].y == a[j].y && j <= n) ++j;
      ans -= (long long)(j - i) * (j - i - 1) / 2;
      i = j - 1;
    }
  }
  printf("%lld\n", ans);
  return 0;
}
