#include <bits/stdc++.h>
using namespace std;
map<int, int> a, b;
struct node {
  int x, y;
  friend bool operator<(node a, node b) {
    if (a.x == b.x) return a.y < b.y;
    return a.x < b.x;
  }
} fre;
long long cnt = 0;
map<node, int> mp;
signed main() {
  int n;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    int x, y;
    scanf("%d%d", &x, &y);
    fre.x = x;
    fre.y = y;
    cnt -= mp[fre];
    mp[fre]++;
    cnt += a[x];
    cnt += b[y];
    a[x]++;
    b[y]++;
  }
  cout << cnt;
  return 0;
}
