#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  long long int n;
  cin >> n;
  map<long long int, long long int> a, b;
  map<pair<long long int, long long int>, long long int> mp;
  long long int x[n], y[n];
  for (long long int i = 0; i < n; i++) {
    cin >> x[i] >> y[i];
    a[x[i]]++;
    b[y[i]]++;
    mp[make_pair(x[i], y[i])]++;
  }
  long long int cnt = 0;
  for (long long int i = 0; i < n; i++) {
    cnt += a[x[i]] - 1;
    cnt += b[y[i]] - 1;
    cnt -= mp[make_pair(x[i], y[i])] - 1;
    a[x[i]]--;
    b[y[i]]--;
    mp[make_pair(x[i], y[i])]--;
  }
  cout << cnt << endl;
  return 0;
}
