#include <bits/stdc++.h>
using namespace std;
void solve() {
  int n;
  cin >> n;
  map<int, int> mx, my;
  map<pair<int, int>, int> mp;
  for (int i = 0; i < n; i++) {
    int first, second;
    cin >> first >> second;
    mx[first]++;
    my[second]++;
    mp[{first, second}]++;
  };
  long long ans = 0;
  for (auto it : mx) {
    ans += (long long)it.second * (it.second - 1) / 2;
  }
  for (auto it : my) {
    ans += (long long)it.second * (it.second - 1) / 2;
  }
  for (auto it : mp) {
    ans -= (long long)it.second * (it.second - 1) / 2;
  }
  cout << ans << '\n';
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  solve();
  return 0;
}
