#include <bits/stdc++.h>
using namespace std;
vector<long long> divisor(long long n) {
  vector<long long> v;
  for (int i = 2; i <= sqrt(n); i++) {
    if (n % i == 0) {
      if (n / i == i)
        v.push_back(i);
      else {
        v.push_back(i);
        v.push_back(n / i);
      }
    }
  }
  return v;
}
vector<long long> sieve() {
  vector<long long> v(1000001);
  int i, j;
  for (i = 0; i < 1000001; i++) v[i] = 1;
  for (i = 2; i <= sqrt(1000001); i++)
    if (v[i] == 1)
      for (j = i * i; j <= 1000000; j += i) v[j] = 0;
  v[1] = 0;
  return v;
}
map<pair<long long, long long>, long long> p;
map<long long, long long> mpx, mpy;
long long x[200005], y[200005];
int main() {
  long long a, b = 31, c, d, e, sum = 0, count = 0, flag = 0, j = 0, i = 1;
  set<long long> se;
  long long n, m, t, k, l, r;
  string s;
  vector<long long> v;
  cin >> n;
  for (i = 0; i < n; i++) {
    cin >> a >> b;
    x[i] = a;
    y[i] = b;
    p[{x[i], y[i]}]++;
    mpx[x[i]]++;
    mpy[y[i]]++;
  }
  long long ans = 0;
  for (i = 0; i < n; i++) {
    ans += mpx[x[i]] + mpy[y[i]] - p[{x[i], y[i]}] - 1;
    mpx[x[i]]--;
    mpy[y[i]]--;
    p[{x[i], y[i]}]--;
  }
  cout << ans;
}
