#include <bits/stdc++.h>
using namespace std;
int mod = 1000000007;
map<int, long long> mpx, mpy;
map<pair<int, int>, long long> mp;
int x[2 * 100005];
int y[2 * 100005];
int main() {
  std::ios::sync_with_stdio(false);
  int n;
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> x[i] >> y[i];
    mpx[x[i]]++;
    mpy[y[i]]++;
    mp[make_pair(x[i], y[i])]++;
  }
  long long ans = 0;
  for (map<int, long long>::iterator it = mpx.begin(); it != mpx.end(); it++) {
    long long z = it->second;
    ans += z * (z - 1) / 2;
  }
  for (map<int, long long>::iterator it = mpy.begin(); it != mpy.end(); it++) {
    long long z = it->second;
    ans += z * (z - 1) / 2;
  }
  for (map<pair<int, int>, long long>::iterator it = mp.begin(); it != mp.end();
       it++) {
    long long z = it->second;
    ans -= z * (z - 1) / 2;
  }
  cout << ans;
}
