#include <bits/stdc++.h>
using namespace std;
int n, x, y, z;
pair<int, int> a[200005];
map<int, int> m, o;
map<pair<int, int>, int> p;
long long q;
int main() {
  scanf("%d", &n);
  ;
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i].first);
    ;
    scanf("%d", &a[i].second);
    ;
    m[a[i].first]++;
    o[a[i].second]++;
    p[make_pair(a[i].first, a[i].second)]++;
  }
  for (int i = 1; i <= n; i++) {
    q += m[a[i].first] + o[a[i].second] - 1 -
         p[make_pair(a[i].first, a[i].second)];
  }
  cout << q / 2 << endl;
  return 0;
}
