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