#include <bits/stdc++.h>
using namespace std;
long long int c(long long int n) { return (n * (n - 1)) / 2; }
map<pair<int, int>, int> is;
int main() {
  int n;
  cin >> n;
  map<int, int> X, Y;
  int minos = 0;
  for (int i = 0; i < n; i++) {
    int x, y;
    cin >> x >> y;
    is[pair<int, int>(x, y)]++;
    X[x]++;
    Y[y]++;
  }
  long long int ans = 0;
  map<int, int>::iterator it = X.begin();
  for (it; it != X.end(); it++) {
    ans += c(it->second);
  }
  it = Y.begin();
  for (it; it != Y.end(); it++) {
    ans += c(it->second);
  }
  map<pair<int, int>, int>::iterator it1;
  it1 = is.begin();
  for (it1; it1 != is.end(); it1++) {
    ans -= c(it1->second);
  }
  cout << ans - minos << endl;
}
