#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  while (scanf("%d", &n) != EOF) {
    map<int, int> x;
    map<int, int> y;
    map<pair<int, int>, int> same;
    long long sum = 0;
    for (int i = 0; i < n; i++) {
      int a, b;
      scanf("%d%d", &a, &b);
      sum += x[a]++;
      sum += y[b]++;
      sum -= same[make_pair(a, b)]++;
    }
    cout << sum << endl;
  }
}
