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