#include <bits/stdc++.h>
using namespace std;
map<int, int> xx;
map<int, int> yy;
map<pair<int, int>, int> cnt;
int main() {
  ios::sync_with_stdio(0);
  int n;
  cin >> n;
  long long ans = 0;
  while (n--) {
    int x, y;
    cin >> x >> y;
    ans += xx[x];
    ans += yy[y];
    ans -= cnt[{x, y}];
    xx[x]++;
    yy[y]++;
    cnt[{x, y}]++;
  }
  cout << ans << endl;
  return 0;
}
