#include <bits/stdc++.h>
using namespace std;
template <typename T>
T gcd(T a, T b) {
  if (a == 0) return b;
  return gcd(b % a, a);
}
template <typename T>
T pow(T a, T b, long long m) {
  T ans = 1;
  while (b > 0) {
    if (b % 2 == 1) ans = ((ans % m) * (a % m)) % m;
    b /= 2;
    a = ((a % m) * (a % m)) % m;
  }
  return ans % m;
}
int cnt[1005];
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  int n;
  cin >> n;
  long long x[n], y[n];
  map<long long, long long> m1, m2, mx, my;
  map<pair<long long, long long>, long long> msum;
  int cnt1 = 0, cnt2 = 0;
  for (int i = 0; i < n; i++) {
    cin >> x[i] >> y[i];
    if (m1.find(x[i]) == m1.end()) m1[x[i]] = (++cnt1);
    if (m2.find(y[i]) == m2.end()) m2[y[i]] = (++cnt2);
  }
  for (int i = 0; i < n; i++) {
    x[i] = m1[x[i]];
    y[i] = m2[y[i]];
  }
  for (int i = 0; i < n; i++) {
    mx[x[i]]++;
    my[y[i]]++;
    msum[make_pair(x[i], y[i])]++;
  }
  long long ans = 0;
  for (map<long long, long long>::iterator it = mx.begin(); it != mx.end();
       it++) {
    ans += ((it->second) * (it->second - 1) / 2);
  }
  for (map<long long, long long>::iterator it = my.begin(); it != my.end();
       it++) {
    ans += ((it->second) * (it->second - 1) / 2);
  }
  for (map<pair<long long, long long>, long long>::iterator it = msum.begin();
       it != msum.end(); it++) {
    ans -= ((it->second) * (it->second - 1) / 2);
  }
  cout << ans;
}
