#include <bits/stdc++.h>
using namespace std;
const long long inf = 1e18;
const long long minf = -(1e18);
pair<int, int> arr[200001];
bool sortx(pair<int, int> a, pair<int, int> b) {
  if (a.first == b.first)
    return a.second < b.second;
  else
    return a.first < b.first;
}
bool sorty(pair<int, int> a, pair<int, int> b) {
  if (a.second == b.second)
    return a.first < b.first;
  else
    return a.second < b.second;
}
int main() {
  ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL);
  long long n;
  cin >> n;
  long long x, y;
  arr[0] = make_pair(-10000000000, -10000000000);
  for (int i = 1; i <= n; i++) {
    cin >> x >> y;
    arr[i] = make_pair(x, y);
  }
  sort(arr + 1, arr + n + 1, sortx);
  long long prev = arr[1].first;
  long long ans = 1;
  long long sum = 0;
  for (int i = 2; i <= n; i++) {
    if (arr[i].first == prev)
      ans++;
    else {
      sum += (ans) * (ans - 1) / 2;
      prev = arr[i].first;
      ans = 1;
    }
  }
  sum += (ans) * (ans - 1) / 2;
  sort(arr + 1, arr + n + 1, sorty);
  prev = arr[1].second;
  ans = 1;
  long long sol = 1;
  long long sumo = 0;
  long long xe = arr[1].first;
  long long ye = arr[1].second;
  for (int i = 2; i <= n; i++) {
    if (arr[i].first == xe && arr[i].second == ye) {
      sol++;
    } else {
      xe = arr[i].first;
      ye = arr[i].second;
      sumo += (sol) * (sol - 1) / 2;
      sol = 1;
    }
    if (arr[i].second == prev)
      ans++;
    else {
      sum += (ans) * (ans - 1) / 2;
      prev = arr[i].second;
      ans = 1;
    }
  }
  sum += (ans) * (ans - 1) / 2;
  sumo += (sol) * (sol - 1) / 2;
  cout << sum - sumo;
  return 0;
}
