#include <bits/stdc++.h>
using namespace std;
const long long maxn = 1e3 + 5;
const long long p = 1000000009;
void solve() {
  long long n;
  cin >> n;
  map<long long, long long> mp_x, mp_y;
  map<pair<long long, long long>, long long> mo;
  long long cnt = 0;
  long long a[n], b[n];
  for (long long i = (0); i < (n); i++) {
    cin >> a[i] >> b[i];
    mp_x[a[i]]++;
    mo[make_pair(a[i], b[i])]++;
  }
  for (long long i = (0); i < (n); i++) {
    mp_y[b[i]]++;
  }
  long long sum = 0;
  for (auto i : mp_x) sum += (i.second * (i.second - 1)) / 2;
  for (auto i : mp_y) sum += (i.second * (i.second - 1)) / 2;
  for (auto i : mo)
    if (i.second > 1) cnt += (i.second * (i.second - 1)) / 2;
  cout << sum - (cnt);
}
int32_t main() { solve(); }
