#include <bits/stdc++.h>
using namespace std;
int n, x, y;
map<int, int> mx, my;
map<pair<int, int>, int> mxy;
long long ans;
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> x >> y;
    int cx = ++mx[x];
    int cy = ++my[y];
    int ce = ++mxy[make_pair(x, y)];
    ans += cx + cy - ce - 1;
  }
  cout << ans << endl;
}
