#include <bits/stdc++.h>
using namespace std;
long n, a[300000], b[300000];
long long s;
map<long, long> x, y;
map<pair<long, long>, long> t;
int main() {
  cin >> n;
  for (long i = 0; i < n; i++) {
    cin >> a[i] >> b[i];
    x[a[i]]++;
    y[b[i]]++;
    pair<long, long> p;
    p.first = a[i];
    p.second = b[i];
    t[p]++;
  }
  for (long i = 0; i < n; i++) {
    pair<long, long> p;
    p.first = a[i];
    p.second = b[i];
    s += (x[a[i]] + y[b[i]] - 1 - t[p]);
  }
  s /= 2;
  cout << s;
}
