#include <bits/stdc++.h>
using namespace std;
int n;
map<pair<int, int>, int> c;
map<int, long long> cnt_x, cnt_y;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> n;
  int x, y;
  for (int i = 0; i < n; i++) {
    cin >> x >> y;
    c[pair<int, int>(x, y)]++;
    cnt_x[x]++;
    cnt_y[y]++;
  }
  long long res = 0LL;
  for (__typeof((cnt_x).begin()) ite = (cnt_x).begin(); ite != (cnt_x).end();
       ite++) {
    if (ite->second > 1LL) {
      res += (ite->second) * (ite->second - 1LL) / 2LL;
    }
  }
  for (__typeof((cnt_y).begin()) ite = (cnt_y).begin(); ite != (cnt_y).end();
       ite++) {
    if (ite->second > 1LL) {
      res += (ite->second) * (ite->second - 1LL) / 2LL;
    }
  }
  for (__typeof((c).begin()) ite = (c).begin(); ite != (c).end(); ite++) {
    if (ite->second > 1LL) {
      res -= (ite->second) * (ite->second - 1LL) / 2LL;
    }
  }
  cout << res << '\n';
  return 0;
}
