#include <bits/stdc++.h>
using namespace std;
int n;
map<int, int> v, h;
map<pair<int, int>, int> pon;
int main() {
  cin >> n;
  int a, b;
  long long rj = 0;
  for (int i = 0; i < n; i++) {
    cin >> a >> b;
    rj += v[a] + h[b] - pon[make_pair(a, b)];
    v[a]++;
    h[b]++;
    pon[make_pair(a, b)]++;
  }
  cout << rj << endl;
}
