#include <bits/stdc++.h>
using namespace std;
const int Maxn = 1e5 + 1, Mod = 1e9 + 7;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  long long n;
  cin >> n;
  map<long long, long long> mp1, mp2;
  map<pair<long long, long long>, long long> mpr;
  for (int i = 0; i < n; i++) {
    long long x, y;
    cin >> x >> y;
    mp1[x]++;
    mp2[y]++;
    mpr[{x, y}]++;
  }
  long long res = 0;
  for (auto x : mp1) {
    res += (1LL * x.second * (1LL * x.second - 1)) / 2;
  }
  for (auto x : mp2) {
    res += (1LL * x.second * (1LL * x.second - 1)) / 2;
  }
  for (auto x : mpr) {
    res -= (1LL * x.second * (1LL * x.second - 1)) / 2;
  }
  cout << res;
  return 0;
}
