#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int t = 1;
  while (t--) {
    long long int n;
    cin >> n;
    unordered_map<long long int, long long int> xp, yp;
    map<pair<long long int, long long int>, long long int> xyp;
    map<pair<long long int, long long int>, long long int>::iterator it1;
    for (int i = 0; i < n; i++) {
      long long int x, y;
      cin >> x >> y;
      xp[x]++;
      yp[y]++;
      pair<long long int, long long int> p(x, y);
      xyp[p]++;
    }
    unordered_map<long long int, long long int>::iterator it;
    long long int ans = 0;
    for (it = xp.begin(); it != xp.end(); it++) {
      long long int temp = it->second;
      ans += (temp * (temp - 1)) / 2;
    }
    for (it = yp.begin(); it != yp.end(); it++) {
      long long int temp = it->second;
      ans += (temp * (temp - 1)) / 2;
    }
    for (it1 = xyp.begin(); it1 != xyp.end(); it1++) {
      long long int temp = it1->second;
      ans -= (temp * (temp - 1)) / 2;
    }
    cout << ans << endl;
  }
  return 0;
}
