#include <bits/stdc++.h>
using namespace std;
map<int, int> a, b;
map<pair<int, int>, int> d;
int main() {
  int n, x, y;
  long long int c = 0;
  scanf("%d", &n);
  while (n--) {
    scanf("%d %d", &x, &y);
    c += a[x] + b[y] - d[make_pair(x, y)];
    a[x]++;
    b[y]++;
    d[make_pair(x, y)]++;
  }
  cout << c;
}
