#include <bits/stdc++.h>
using namespace std;
int main() {
  long long m, n, t, b, c, d, i, j, k, x, y, z, l, q, r;
  long long cnt = 0, ans = 0;
  map<long long, long long> mp1, mp2;
  map<pair<long long, long long>, long long> mp;
  scanf("%lld", &n);
  long long a[n];
  for (i = 0; i < n; i++) {
    cin >> x >> y;
    ans += mp1[x];
    mp1[x]++;
    ans += mp2[y];
    mp2[y]++;
    ans -= mp[make_pair(x, y)];
    mp[make_pair(x, y)]++;
  }
  printf("%lld\n", ans);
  return 0;
}
