#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:1000000000")
using namespace std;
const int maxn = (int)2e5 + 10;
pair<int, int> v[maxn];
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    scanf("%d %d", &v[i].first, &v[i].second);
  }
  sort(v, v + n);
  long long ans = 0;
  long long cnt = 1;
  for (int i = 1; i < n; i++) {
    if (v[i].first == v[i - 1].first) {
      cnt++;
    } else {
      ans += cnt * (cnt - 1) / 2;
      cnt = 1;
    }
  }
  ans += cnt * (cnt - 1) / 2;
  for (int i = 0; i < n; i++) {
    swap(v[i].first, v[i].second);
  }
  sort(v, v + n);
  cnt = 1;
  for (int i = 1; i < n; i++) {
    if (v[i].first == v[i - 1].first) {
      cnt++;
    } else {
      ans += cnt * (cnt - 1) / 2;
      cnt = 1;
    }
  }
  ans += cnt * (cnt - 1) / 2;
  cnt = 1;
  for (int i = 1; i < n; i++) {
    if (v[i] == v[i - 1]) {
      cnt++;
    } else {
      ans -= cnt * (cnt - 1) / 2;
      cnt = 1;
    }
  }
  ans -= cnt * (cnt - 1) / 2;
  cout << ans << endl;
  return 0;
}
