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