#include <bits/stdc++.h>
using namespace std;
const long long INF = 1e18;
const long long mod = 1e9 + 7;
const long long N = 1e5 + 10;
int main() {
  ios::sync_with_stdio(false);
  long long n;
  cin >> n;
  vector<pair<long long, long long> > v(n);
  for (long long i = 0; i < n; i++) cin >> v[i].first >> v[i].second;
  map<long long, long long> m;
  for (long long i = 0; i < n; i++) m[v[i].first]++;
  long long ans = 0;
  for (auto it : m) ans += it.second * (it.second - 1) / 2;
  m.clear();
  for (long long i = 0; i < n; i++) m[v[i].second]++;
  for (auto it : m) ans += it.second * (it.second - 1) / 2;
  map<pair<long long, long long>, long long> freq;
  for (long long i = 0; i < n; i++) freq[make_pair(v[i].first, v[i].second)]++;
  for (auto it : freq) ans -= it.second * (it.second - 1) / 2;
  cout << ans << endl;
  return 0;
}
