#include <bits/stdc++.h>
using namespace std;
long long fp(long long n, long long p) {
  if (p == 0) return 1;
  if (p == 1) return n;
  long long res;
  res = fp(n, p / 2);
  res = (res * res);
  if (p % 2) res = (res * n);
  return res;
}
bool comp(pair<long long, long long> a, pair<long long, long long> b) {
  if (a.first != b.first)
    return (a.first < b.first);
  else
    return (a.second < b.second);
}
bool comp2(pair<long long, long long> a, pair<long long, long long> b) {
  return (a.second < b.second);
}
long long n, m, a, b, ans = 0;
pair<long long, long long> arr[200001];
int main() {
  ios::sync_with_stdio(0);
  ios_base::sync_with_stdio(0);
  cin.tie(0), cout.tie(0);
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> arr[i].first >> arr[i].second;
  }
  sort(arr, arr + n, comp2);
  a = 0;
  while (a < n) {
    long long l = a, cur = arr[a].second;
    while (a < n) {
      if (arr[a].second == cur)
        a++;
      else
        break;
    }
    long long t = a - l;
    ans += t * (t - 1) / 2;
  }
  sort(arr, arr + n, comp);
  a = 0;
  while (a < n) {
    long long l = a, cur = arr[a].first;
    while (a < n) {
      if (arr[a].first == cur)
        a++;
      else
        break;
    }
    long long t = a - l;
    ans += t * (t - 1) / 2;
  }
  a = 0;
  while (a < n) {
    int l = a, cux = arr[a].first, cuy = arr[a].second;
    while (a < n) {
      if (cux == arr[a].first && cuy == arr[a].second)
        a++;
      else
        break;
    }
    long long q = a - l;
    ans -= q * (q - 1) / 2;
  }
  cout << ans << '\n';
  return 0;
}
