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