#include <bits/stdc++.h>
using namespace std;
bool sortmd(pair<pair<int, int>, int> &a, pair<pair<int, int>, int> &b) {
  if (a.first.first == b.first.first) return a.first.second < b.first.second;
  return a.first.first > b.first.first;
}
bool sortm(pair<int, int> &a, pair<int, int> &b) {
  if (a.first == b.first) {
    return a.second < b.second;
  }
  return a.first < b.first;
}
int main() {
  ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  srand(time(NULL));
  int t;
  t = 1;
  while (t--) {
    long long n, i, j, ans = 0;
    cin >> n;
    long long x, y;
    map<pair<long long, long long>, long long> mp;
    map<long long, long long> xx, yy;
    for (i = 0; i < n; i++) {
      cin >> x >> y;
      xx[x]++;
      yy[y]++;
      mp[{x, y}]++;
    }
    for (auto it = xx.begin(); it != xx.end(); it++) {
      j = it->second;
      ans = ans + (j * (j - 1)) / 2;
    }
    for (auto it = yy.begin(); it != yy.end(); it++) {
      j = it->second;
      ans = ans + (j * (j - 1)) / 2;
    }
    for (auto it = mp.begin(); it != mp.end(); it++) {
      j = it->second;
      ans = ans - (j * (j - 1)) / 2;
    }
    cout << ans;
  }
  return 0;
}
