#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n;
  cin >> n;
  long long int cnt = 0;
  set<pair<long long int, long long int>> s;
  unordered_map<long long int, long long int> xcord, ycord;
  map<pair<long long int, long long int>, long long int> repeat;
  for (int i = 0; i < n; i++) {
    long long int x, y;
    cin >> x >> y;
    repeat[{x, y}]++;
    s.insert({x, y});
    xcord[x]++;
    ycord[y]++;
  }
  for (auto x : repeat) {
    cnt += (x.second * (x.second - 1)) / 2;
  }
  long long int ans = 0;
  for (auto x : xcord) {
    ans += (x.second * (x.second - 1)) / 2;
  }
  for (auto x : ycord) {
    ans += (x.second * (x.second - 1)) / 2;
  }
  cout << ans - cnt << "\n";
  return 0;
}
