#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0), cout.tie(0);
  ;
  long long int t, a, b, n, m, k, i, j, sum = 0, d = 0, p;
  map<pair<long long int, long long int>, long long int> mp;
  map<long long int, long long int> mp1, mp2;
  cin >> n;
  for (i = 0; i < n; i++) {
    cin >> a >> b;
    mp[{a, b}]++;
    mp1[a]++;
    mp2[b]++;
  }
  for (auto i : mp1) {
    sum += (i.second * (i.second - 1)) / 2;
  }
  for (auto i : mp2) {
    sum += (i.second * (i.second - 1)) / 2;
  }
  for (auto i : mp) {
    sum -= (i.second * (i.second - 1)) / 2;
  }
  cout << sum << '\n';
  return 0;
}
