#include <bits/stdc++.h>
using namespace std;
map<int, long long> x;
map<int, long long> y;
map<pair<int, int>, long long> xy;
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    int X, Y;
    scanf("%d%d", &X, &Y);
    x[X]++;
    y[Y]++;
    xy[make_pair(X, Y)]++;
  }
  map<int, long long>::iterator it;
  long long ans = 0;
  for (it = x.begin(); it != x.end(); it++) {
    long long p = it->second;
    ans += (p * (p - 1) / 2);
  }
  for (it = y.begin(); it != y.end(); it++) {
    long long p = it->second;
    ans += (p * (p - 1) / 2);
  }
  map<pair<int, int>, long long>::iterator it2;
  for (it2 = xy.begin(); it2 != xy.end(); it2++) {
    long long p = it2->second;
    ans -= (p * (p - 1) / 2);
  }
  cout << ans << endl;
}
