#include <bits/stdc++.h>
using namespace std;
map<int, int> X, Y;
map<pair<int, int>, int> S;
int main() {
  std::ios_base::sync_with_stdio(false);
  int n;
  cin >> n;
  for (int i = 0; i < int(n); i++) {
    int first, second;
    cin >> first >> second;
    X[first]++;
    Y[second]++;
    S[make_pair(first, second)]++;
  }
  long long ans = 0;
  for (auto a : (X)) {
    ans += 1ll * a.second * (a.second - 1) / 2;
  }
  for (auto a : (Y)) {
    ans += 1ll * a.second * (a.second - 1) / 2;
  }
  for (auto a : (S)) {
    ans -= 1ll * a.second * (a.second - 1) / 2;
  }
  cout << ans;
  return 0;
}
