#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n;
  cin >> n;
  map<long long, long long> x;
  map<long long, long long> y;
  map<pair<long long, long long>, long long> total;
  for (long long i = 0; i < n; ++i) {
    long long cx, cy;
    cin >> cx;
    cin >> cy;
    x[cx] += 1;
    y[cy] += 1;
    total[make_pair(cx, cy)] += 1;
  }
  long long res = 0;
  for (auto it = x.begin(); it != x.end(); ++it) {
    long long v = it->second;
    if (v <= 1) {
      continue;
    }
    res += v * (v - 1) / 2;
  }
  for (auto it = y.begin(); it != y.end(); ++it) {
    long long v = it->second;
    if (v <= 1) {
      continue;
    }
    res += v * (v - 1) / 2;
  }
  for (auto it = total.begin(); it != total.end(); ++it) {
    long long v = it->second;
    if (v <= 1) {
      continue;
    }
    res -= v * (v - 1) / 2;
  }
  cout << res << "\n";
  return 0;
}
