#include <bits/stdc++.h>
using namespace std;
vector<pair<long long int, long long int>> v, v1;
int main() {
  int n;
  long long int a, b;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a >> b;
    v.push_back(make_pair(a, b));
    v1.push_back(make_pair(b, a));
  }
  sort(v.begin(), v.end());
  sort(v1.begin(), v1.end());
  long long int val = 1000000009, count, x, ans = 0;
  for (int i = 0; i < n; i++) {
    count = 0;
    while (v[i].first == val && i < n) {
      count++;
      i++;
    }
    if (v[i].first != val) val = v[i].first;
    x = count + 1;
    ans += ((x) * (x - 1)) / 2;
  }
  val = 1000000009;
  for (int i = 0; i < n; i++) {
    count = 0;
    while (v1[i].first == val && i < n) {
      count++;
      i++;
    }
    if (v1[i].first != val) val = v1[i].first;
    x = count + 1;
    ans += ((x) * (x - 1)) / 2;
  }
  pair<long long int, long long int> p;
  p = make_pair(1000000009, 1000000009);
  long long int sum = 0;
  for (int i = 0; i < n; i++) {
    count = 0;
    while (v[i] == p && i < n) {
      count++;
      i++;
    }
    if (v[i] != p) p = v[i];
    x = count + 1;
    sum += ((x) * (x - 1)) / 2;
  }
  cout << ans - sum << "\n";
  return 0;
}
