#include <bits/stdc++.h>
using namespace std;
long long int calc(long long int x) {
  if (x == 0 || x == 1) {
    return 0;
  }
  return (x * (x - 1)) / 2;
}
int main(void) {
  int n;
  cin >> n;
  int i;
  map<int, int> x;
  map<int, int> y;
  map<pair<int, int>, int> v;
  int a, b;
  pair<int, int> tom;
  for (i = 0; i < n; i++) {
    cin >> a >> b;
    tom = (pair<int, int>){a, b};
    v[tom]++;
    x[a]++;
    y[b]++;
  }
  int temp;
  long long int ans = 0;
  map<int, int>::iterator it;
  for (it = x.begin(); it != x.end(); it++) {
    ans += (long long int)calc((long long int)it->second);
  }
  map<pair<int, int>, int>::iterator ite;
  for (ite = v.begin(); ite != v.end(); ite++) {
    ans -= (long long int)calc((long long int)ite->second);
  }
  for (it = y.begin(); it != y.end(); it++) {
    ans += (long long int)calc((long long int)it->second);
  }
  cout << ans;
}
