#include <bits/stdc++.h>
using namespace std;
long long mod_exp(long long a, long long b, long long c) {
  long long res = 1;
  a = a % c;
  while (b > 0) {
    if (b % 2 == 1) {
      res = (res * a) % c;
    }
    b /= 2;
    a = (a * a) % c;
  }
  return res;
}
long long gcd(long long a, long long b) {
  if (b == 0) {
    return a;
  }
  return gcd(b, a % b);
}
bool my(pair<long long, long long> p1, pair<long long, long long> p2) {
  if (p1.first < p2.first) return true;
  if (p1.first == p2.first && p1.second < p2.second) return true;
  return false;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long n;
  cin >> n;
  long long a, b;
  long long ans = 0;
  unordered_map<long long, long long> mx, my;
  map<pair<long long, long long>, long long> p;
  for (long long i = 0; i < n; i++) {
    cin >> a >> b;
    mx[a]++;
    my[b]++;
    p[{a, b}]++;
  }
  for (auto itr = mx.begin(); itr != mx.end(); itr++) {
    ans += ((itr->second) * (itr->second - 1)) / 2;
  }
  for (auto itr = my.begin(); itr != my.end(); itr++) {
    ans += ((itr->second) * (itr->second - 1)) / 2;
  }
  for (auto itr = p.begin(); itr != p.end(); itr++) {
    ans -= ((itr->second) * (itr->second - 1)) / 2;
  }
  cout << ans << endl;
  return 0;
}
