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