#include <bits/stdc++.h>
using namespace std;
const long long MX = 501;
long long n, ans;
map<long long, long long> mpx, mpy;
map<pair<long long, long long>, int> mp;
int main() {
  cin >> n;
  for (int i = 0; i < n; ++i) {
    long long x, y;
    cin >> x >> y;
    mpx[x]++;
    mpy[y]++;
    mp[make_pair(x, y)]++;
  }
  map<long long, long long>::iterator it;
  map<pair<long long, long long>, int>::iterator itt;
  for (it = mpx.begin(); it != mpx.end(); ++it) {
    long long m = (*it).second;
    ans += (m * (m - 1)) / 2;
  }
  for (it = mpy.begin(); it != mpy.end(); ++it) {
    long long m = (*it).second;
    ans += (m * (m - 1)) / 2;
  }
  for (itt = mp.begin(); itt != mp.end(); ++itt) {
    long long m = (*itt).second;
    ans -= (m * (m - 1)) / 2;
  }
  cout << ans;
  return 0;
}
