#include <bits/stdc++.h>
using namespace std;
long long big = 1000000007ll;
long long n, m, k, q, d;
long long T;
std::map<long long, long long> MX;
std::map<long long, long long> MY;
std::map<long long, long long> MXY;
std::vector<long long> X;
std::vector<long long> Y;
std::vector<long long> ind;
std::vector<long long> ind2;
bool comp(long long i, long long j) {
  if (X[i] == X[j]) {
    return Y[i] < Y[j];
  }
  return X[i] < X[j];
}
bool comp2(long long i, long long j) { return Y[i] < Y[j]; }
int main() {
  long long c1, c2, c3, c4, c5, c6;
  long long x, y, z;
  long long a, b, c, e;
  std::cin >> n;
  long long nxy = 0;
  for (c1 = 0; c1 < n; c1++) {
    std::cin >> a >> b;
    X.push_back(a);
    Y.push_back(b);
    ind.push_back(c1);
    ind2.push_back(c1);
  }
  X.push_back(2000000000ll);
  Y.push_back(2000000000ll);
  ind.push_back(n);
  ind2.push_back(n);
  std::sort(ind.begin(), ind.end(), comp);
  std::sort(ind2.begin(), ind2.end(), comp2);
  b = 1;
  long long nx = 0;
  long long ny = 0;
  d = 1;
  for (c1 = 0; c1 < n; c1++) {
    a = ind[c1];
    c = ind[c1 + 1];
    if (X[a] == X[c]) {
      b++;
    } else {
      nx += b * (b - 1) / 2;
      b = 1;
    }
    if (X[a] == X[c] && Y[a] == Y[c]) {
      d++;
    } else {
      nxy += d * (d - 1) / 2;
      d = 1;
    }
  }
  b = 1;
  for (c1 = 0; c1 < n; c1++) {
    a = ind2[c1];
    c = ind2[c1 + 1];
    if (Y[a] == Y[c]) {
      b++;
    } else {
      ny += b * (b - 1) / 2;
      b = 1;
    }
  }
  std::cout << nx + ny - nxy << "\n";
  return 0;
}
