#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 1;
map<long long, long long> x, y;
map<pair<long long, long long>, long long> q;
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    long long a, b;
    cin >> a >> b;
    x[a]++;
    y[b]++;
    q[{a, b}]++;
  }
  long long ans = 0;
  for (auto el : x) {
    ans += (el.second * (el.second - 1)) / 2;
  }
  for (auto el : y) {
    ans += (el.second * (el.second - 1)) / 2;
  }
  for (auto el : q) {
    ans -= (el.second * (el.second - 1)) / 2;
  }
  cout << ans << endl;
  return 0;
}
