#include <bits/stdc++.h>
using namespace std;
const long long int inf = 1000000000000000LL;
int getpower(int a) {
  int p = 1;
  while (p <= a) {
    p <<= 1;
  }
  return p;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n;
  long long int ans = 0;
  int a, b;
  cin >> n;
  map<int, int> x, y;
  map<pair<long long int, int>, int> cont;
  for (int i = 0; i < n; i++) {
    cin >> a >> b;
    if (x.find(a) != x.end()) {
      ans += x[a];
    }
    if (y.find(b) != y.end()) {
      ans += y[b];
    }
    if (cont.find(pair<long long int, int>(a, b)) != cont.end()) {
      ans -= cont[pair<long long int, int>(a, b)];
    }
    cont[pair<long long int, int>(a, b)]++;
    x[a]++;
    y[b]++;
  }
  cout << ans;
  return 0;
}
