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