#include <bits/stdc++.h>
using namespace std;
int main() {
  unsigned long long int cnt = 0;
  map<unsigned long long int, unsigned long long int> x, y;
  map<pair<unsigned long long int, unsigned long long int>,
      unsigned long long int>
      mp;
  int n, a, b;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a >> b;
    mp[{a, b}]++;
    x[a]++;
    y[b]++;
  }
  for (auto z : x) {
    cnt += (z.second) * (z.second - 1) / 2;
  }
  for (auto z : y) {
    cnt += (z.second) * (z.second - 1) / 2;
  }
  for (auto z : mp) {
    cnt -= (z.second) * (z.second - 1) / 2;
  }
  cout << cnt << endl;
  return 0;
}
