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