#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 5;
map<int, long long> m1, m2;
map<pair<int, int>, long long> m3;
int n, x[N], y[N];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> x[i] >> y[i];
    m1[x[i]] += 1;
    m2[y[i]] += 1;
    m3[{x[i], y[i]}] += 1;
  }
  long long res = 0;
  for (auto w : m1) {
    long long now = w.second;
    res += now * (now - 1) / 2;
  }
  for (auto w : m2) {
    long long now = w.second;
    res += now * (now - 1) / 2;
  }
  for (auto w : m3) {
    long long now = w.second;
    res -= now * (now - 1) / 2;
  }
  cout << res << endl;
  return 0;
}
