#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) {
  if (b == 0) {
    return a;
  }
  return gcd(b, a % b);
}
long long lcm(long long a, long long b) { return ((a * b) / gcd(a, b)); }
long long int read_int() {
  char r;
  bool start = false, neg = false;
  long long int ret = 0;
  while (true) {
    r = getchar();
    if ((r - '0' < 0 || r - '0' > 9) && r != '-' && !start) {
      continue;
    }
    if ((r - '0' < 0 || r - '0' > 9) && r != '-' && start) {
      break;
    }
    if (start) ret *= 10;
    start = true;
    if (r == '-')
      neg = true;
    else
      ret += r - '0';
  }
  if (!neg)
    return ret;
  else
    return -ret;
}
int main() {
  map<long long, long long> x;
  map<long long, long long> y;
  map<pair<long long, long long>, long long> z;
  long long n, a, b, ans = 0;
  n = read_int();
  while (n--) {
    a = read_int();
    b = read_int();
    ans += (x[a]++);
    ans += (y[b]++);
    ans -= z[make_pair(a, b)]++;
  }
  cout << ans;
  return 0;
}
