#include <bits/stdc++.h>
using namespace std;
int dx[8] = {0, -1, 0, 1, -1, -1, 1, 1};
int dy[8] = {1, 0, -1, 0, 1, -1, 1, -1};
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  ;
  int t, n, m;
  map<int, int> mpx, mpy;
  map<pair<int, int>, int> mpxy;
  cin >> n;
  int x, y;
  for (int i = 0; i < n; i++) {
    cin >> x >> y;
    mpx[x]++;
    mpy[y]++;
    mpxy[make_pair(x, y)]++;
  }
  map<int, int>::iterator it;
  long long ans = 0;
  for (it = mpx.begin(); it != mpx.end(); it++) {
    ans += ((long long)(it->second) * (long long)(it->second - 1LL)) / 2LL;
  }
  for (it = mpy.begin(); it != mpy.end(); it++) {
    ans += ((long long)(it->second) * (long long)(it->second - 1LL)) / 2LL;
  }
  long long ans2 = 0;
  for (map<pair<int, int>, int>::iterator itx = mpxy.begin(); itx != mpxy.end();
       itx++) {
    ans2 += ((long long)(itx->second) * (long long)(itx->second - 1LL)) / 2LL;
  }
  cout << ans - ans2;
  return 0;
}
