#include <bits/stdc++.h>
using namespace std;
struct Point {
  int x, y;
  bool operator<(const Point &rhs) const {
    return x < rhs.x || (x == rhs.x && y < rhs.y);
  }
  bool operator==(const Point &rhs) const { return x == rhs.x && y == rhs.y; }
};
map<Point, int> P;
map<int, int> X, Y;
int main() {
  long long ans = 0;
  int n;
  scanf("%d", &n);
  while (n--) {
    Point p;
    scanf("%d%d", &p.x, &p.y);
    ans += X[p.x];
    ans += Y[p.y];
    ans -= P[p];
    X[p.x]++;
    Y[p.y]++;
    P[p]++;
  }
  printf("%I64d\n", ans);
  return 0;
}
