#include <bits/stdc++.h>
using namespace std;
void fast() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
}
int main() {
  fast();
  int n;
  cin >> n;
  long long int cnt = 0;
  map<int, int> mpx, mpy;
  map<pair<int, int>, int> mp;
  while (n--) {
    int x, y;
    cin >> x >> y;
    auto it = mpx.find(x);
    if (it != mpx.end()) cnt += it->second;
    it = mpy.find(y);
    if (it != mpy.end()) cnt += it->second;
    auto it2 = mp.find({x, y});
    if (it2 != mp.end()) cnt -= it2->second;
    mpx[x]++;
    mpy[y]++;
    mp[{x, y}]++;
  }
  cout << cnt;
  return 0;
}
