#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n;
  cin >> n;
  vector<pair<long long, long long>> v;
  map<long long, long long> mph, mpv;
  map<pair<long long, long long>, long long> mp;
  long long ans = 0;
  for (long long i = 1; i <= n; i++) {
    long long x, y;
    cin >> x;
    cin >> y;
    v.push_back({x, y});
    mph[x]++;
    mpv[y]++;
    ans -= mp[{x, y}]++;
  }
  for (auto it : mph) {
    long long k = it.second;
    ans += (k * (k - 1)) / 2;
  }
  for (auto it : mpv) {
    long long k = it.second;
    ans += (k * (k - 1)) / 2;
  }
  cout << ans;
}
