#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b, n;
  cin >> n;
  map<pair<int, int>, long long> points;
  map<int, long long> m1;
  map<int, long long> m2;
  while (n--) {
    cin >> a >> b;
    points[make_pair(a, b)]++;
    m1[a]++;
    m2[b]++;
  }
  long long ans = 0;
  for (map<int, long long>::iterator it = m1.begin(); it != m1.end(); ++it) {
    ans += (it->second) * (it->second - 1) / 2ll;
  }
  for (map<int, long long>::iterator it = m2.begin(); it != m2.end(); ++it) {
    ans += (it->second) * (it->second - 1) / 2ll;
  }
  for (map<pair<int, int>, long long>::iterator it = points.begin();
       it != points.end(); ++it) {
    ans -= (it->second) * (it->second - 1) / 2ll;
  }
  cout << ans << endl;
}
