#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, a, b;
  long long ans = 0;
  map<int, int> mx, my;
  map<pair<int, int>, int> m;
  cin >> n;
  while (n--) {
    cin >> a >> b;
    ans += (mx[a]++ + my[b]++);
    ans -= m[make_pair(a, b)]++;
  }
  cout << ans;
  return 0;
}
