#include <bits/stdc++.h>
using namespace std;
long long b, n, i, l, r, ans;
pair<int, int> a[200001];
int main() {
  cin >> n;
  for (i = 1; i <= n; i++) {
    cin >> l >> r;
    a[i].first = l;
    a[i].second = r;
  }
  sort(a + 1, a + n + 1);
  b = 1;
  for (i = 2; i <= n; i++)
    if (a[i].first == a[i - 1].first && a[i].second == a[i - 1].second)
      b++;
    else {
      ans -= b * (b - 1) / 2;
      b = 1;
    }
  ans -= b * (b - 1) / 2;
  b = 1;
  for (i = 2; i <= n; i++)
    if (a[i].first == a[i - 1].first)
      b++;
    else {
      ans += b * (b - 1) / 2;
      b = 1;
    }
  ans += b * (b - 1) / 2;
  for (i = 1; i <= n; i++) swap(a[i].first, a[i].second);
  sort(a + 1, a + n + 1);
  b = 1;
  for (i = 2; i <= n; i++)
    if (a[i].first == a[i - 1].first)
      b++;
    else {
      ans += b * (b - 1) / 2;
      b = 1;
    }
  ans += b * (b - 1) / 2;
  cout << ans << endl;
}
