#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n;
  cin >> n;
  map<pair<long long, long long>, long long> f;
  for (int i = 0; i < n; i++) {
    long long a, b;
    cin >> a >> b;
    if (f.find({a, b}) == f.end())
      f.insert({{a, b}, 1});
    else {
      f[{a, b}]++;
    }
  }
  long long ans = 0;
  unordered_map<long long, long long> fx, fy;
  for (auto i : f) {
    fx[i.first.first] += i.second;
    fy[i.first.second] += i.second;
  }
  for (auto i : fx) {
    ans += (i.second) * (i.second - 1) / 2;
  }
  for (auto i : fy) {
    ans += (i.second) * (i.second - 1) / 2;
  }
  for (auto i : f) ans -= (i.second) * (i.second - 1) / 2;
  cout << ans << "\n";
  return 0;
}
