#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<pair<int, int> > vec(n);
  vector<int> x(n);
  vector<int> y(n);
  for (int i = 0; i < n; i++) {
    cin >> x[i] >> y[i];
    vec[i].first = x[i];
    vec[i].second = y[i];
  }
  long long ans = 0;
  sort(x.begin(), x.end());
  long long count = 1;
  for (int i = 1; i < n; i++) {
    if (x[i] != x[i - 1]) {
      ans += (count * (count - 1)) / 2;
      count = 0;
    }
    count++;
  }
  ans += (count * (count - 1)) / 2;
  sort(y.begin(), y.end());
  count = 1;
  for (int i = 1; i < n; i++) {
    if (y[i] != y[i - 1]) {
      ans += (count * (count - 1)) / 2;
      count = 0;
    }
    count++;
  }
  ans += (count * (count - 1)) / 2;
  sort(vec.begin(), vec.end());
  count = 1;
  for (int i = 1; i < n; i++) {
    if (vec[i].first != vec[i - 1].first ||
        vec[i].second != vec[i - 1].second) {
      ans -= (count * (count - 1)) / 2;
      count = 0;
    }
    count++;
  }
  ans -= (count * (count - 1)) / 2;
  cout << ans << endl;
}
