#include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 20;
const int oo = 1e9;
const int MOD = 1e9 + 7;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int n;
  while (cin >> n) {
    map<int, int> cnt1, cnt2;
    map<pair<int, int>, int> equal;
    for (int i = 0; i < n; i++) {
      int x, y;
      cin >> x >> y;
      cnt1[x]++;
      cnt2[y]++;
      equal[{x, y}]++;
    }
    long long ans = 0;
    for (auto &e : cnt1) {
      ans += 1ll * e.second * (e.second - 1) / 2;
    }
    for (auto &e : cnt2) {
      ans += 1ll * e.second * (e.second - 1) / 2;
    }
    for (auto &e : equal) {
      ans -= 1ll * e.second * (e.second - 1) / 2;
    }
    cout << ans << '\n';
  }
  return 0;
}
