#include <bits/stdc++.h>
using namespace std;
map<pair<long long, long long>, long long> m;
map<long long, long long> a, b;
int n, k;
int main() {
  cin >> n;
  long long l;
  for (int i = 0; i < n; i++) {
    cin >> k >> l;
    m[make_pair(k, l)]++;
    a[k]++;
    b[l]++;
  }
  long long sol = 0, v = 0;
  for (auto p : m) {
    sol -= (p.second * (p.second - 1)) / 2;
  }
  for (auto p : a) {
    sol += (p.second * (p.second - 1)) / 2;
  }
  for (auto p : b) {
    sol += (p.second * (p.second - 1)) / 2;
  }
  cout << sol;
  return 0;
}
