#include <bits/stdc++.h>
using namespace std;
int n, p, q;
vector<pair<int, int> > a;
set<pair<int, int> > s;
map<int, int> xx, yy;
map<pair<int, int>, int> r;
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= (n); ++i) {
    scanf("%d %d", &p, &q);
    a.push_back(make_pair(p, q));
    s.insert(make_pair(p, q));
    r[make_pair(p, q)]++;
    xx[p]++;
    yy[q]++;
  }
  long long int res = 0;
  for (__typeof((a).begin()) it = ((a).begin()); it != (a).end(); ++it) {
    res += (xx[it->first] - 1);
    res += (yy[it->second] - 1) - (r[*it] - 1);
  }
  res /= 2;
  cout << res << "\n";
  return 0;
}
