#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  int n;
  cin >> n;
  unordered_map<int, int> h, v;
  map<pair<int, int>, int> p;
  int x, y;
  for (int ctr1 = 0; ctr1 < n; ctr1++) {
    cin >> x >> y;
    h[x]++;
    v[y]++;
    p[make_pair(x, y)]++;
  }
  long long rez = 0;
  for (pair<const int, int> &t : h) {
    long long k = t.second;
    rez += (k * (k - 1)) / 2;
  }
  for (pair<const int, int> &t : v) {
    long long k = t.second;
    rez += (k * (k - 1)) / 2;
  }
  for (pair<const pair<int, int>, int> t : p) {
    long long k = t.second;
    rez -= (k * (k - 1)) / 2;
  }
  cout << rez << endl;
  return 0;
}
