#include <bits/stdc++.h>
using namespace std;
map<int, int> mp1, mp2;
map<pair<int, int>, int> mp;
int n, x, y;
void solve() {
  mp1.clear();
  mp2.clear();
  mp.clear();
  long long ans = 0;
  for (int i = 0; i < n; ++i) {
    scanf("%d%d", &x, &y);
    pair<int, int> t(x, y);
    ans += mp1[x] + mp2[y] - mp[t];
    mp1[x]++;
    mp2[y]++;
    mp[t]++;
  }
  printf("%I64d\n", ans);
}
int main() {
  while (~scanf("%d", &n)) solve();
  return 0;
}
