#include <bits/stdc++.h>
using namespace std;
map<int, int> x, y;
map<pair<int, int>, int> p;
long long int ans = 0;
int main() {
  int n, s, t;
  scanf("%d", &n);
  while (n--) {
    scanf("%d%d", &s, &t);
    ans += x[s]++;
    ans += y[t]++;
    ans -= p[make_pair(s, t)]++;
  }
  cout << ans << endl;
  return 0;
}
