#include <bits/stdc++.h>
using namespace std;
long long int modD(long long int a, long long int b) {
  return a > b ? a - b : b - a;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ;
  long long int n;
  cin >> n;
  multiset<pair<long long int, long long int> > v;
  long long int cnt = 0;
  for (long long int i = 0; i < n; i++) {
    long long int a, b;
    cin >> a >> b;
    v.insert(make_pair(a, b));
  }
  set<pair<long long int, long long int> > s;
  for (auto x : v) {
    if (s.find(x) == s.end()) {
      long long int a = v.count(x);
      cnt -= (a * (a - 1)) / 2;
      s.insert(x);
    }
  }
  map<long long int, long long int> mp1;
  map<long long int, long long int> mp2;
  for (auto x : v) {
    mp1[x.first]++;
    mp2[x.second]++;
  }
  for (auto x : mp1) {
    long long int a = x.second;
    cnt += (a) * (a - 1) / 2;
  }
  for (auto x : mp2) {
    long long int a = x.second;
    cnt += (a) * (a - 1) / 2;
  }
  cout << cnt;
}
