#include <bits/stdc++.h>
using namespace std;
int main() {
  map<int, signed long long int> xy;
  map<int, signed long long int> yx;
  map<pair<int, int>, signed long long int> pr;
  signed long long int ans = 0;
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    int x, y;
    cin >> x >> y;
    ans += xy[x];
    ans += yx[y];
    ans -= pr[make_pair(x, y)];
    pr[make_pair(x, y)]++;
    xy[x]++;
    yx[y]++;
  }
  cout << ans;
  return 0;
}
