#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  map<int, int> a, b;
  map<pair<int, int>, int> c;
  long long times = 0;
  for (int i = int(0); i < int(n); i++) {
    int x, y;
    cin >> x >> y;
    times += a[x]++ + b[y]++ - c[make_pair(x, y)]++;
  }
  cout << times << endl;
  return 0;
}
