#include <bits/stdc++.h>
using namespace std;
long long exp(long long x, long long y) {
  x %= 1000000007;
  long long res = 1;
  while (y) {
    if (y & 1) res = res * x % 1000000007;
    x = x * x % 1000000007;
    y >>= 1;
  }
  return res;
}
int main() {
  int n;
  cin >> n;
  vector<int> a(n), b(n);
  map<int, int> mp1, mp2;
  for (int i = 1; i <= n; ++i) {
    cin >> a[i - 1] >> b[i - 1];
    mp1[a[i - 1]] += 1;
    mp2[b[i - 1]] += 1;
  }
  long long ans = 0;
  for (int i = 0; i <= n - 1; ++i) {
    --mp1[a[i]];
    ans += mp1[a[i]];
  }
  for (int i = 0; i <= n - 1; ++i) {
    --mp2[b[i]];
    ans += mp2[b[i]];
  }
  map<pair<int, int>, int> mp;
  for (int i = 0; i <= n - 1; ++i) mp[{a[i], b[i]}]++;
  for (int i = 0; i <= n - 1; ++i) {
    --mp[{a[i], b[i]}];
    ans -= mp[{a[i], b[i]}];
  }
  cout << ans;
  return 0;
}
