#include <bits/stdc++.h>
using namespace std;
long long n, x, y, ans;
map<long long, long long> a, b;
map<pair<long long, long long>, long long> c;
int main() {
  for (cin >> n; cin >> x >> y;)
    ans += (a[x]++) + (b[y]++) - (c[make_pair(x, y)]++);
  cout << ans << endl;
  return 0;
}
