#include <bits/stdc++.h>
using namespace std;
void swap(long long int &x, long long int &y) {
  x = x ^ y;
  y = x ^ y;
  x = x ^ y;
}
template <typename T>
void print(T a) {
  for (auto i = a.begin(); i != a.end(); i++) cout << *i << " ";
  cout << endl;
}
bool isVowel(char c) {
  if (c == 'a' || c == 'e' || c == 'i' || c == 'o' || c == 'u') return true;
  return false;
}
void sync() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
}
int main() {
  sync();
  long long int n;
  cin >> n;
  map<long long int, long long int> ck1, ck2;
  map<pair<long long int, long long int>, long long int> ck3;
  while (n--) {
    long long int x, y;
    cin >> x >> y;
    ck1[x]++;
    ck2[y]++;
    ck3[{x, y}]++;
  }
  long long int ans = 0;
  for (auto i = ck1.begin(); i != ck1.end(); i++) {
    long long int x = i->second;
    ans += ((x) * (x - 1) / 2);
  }
  for (auto i = ck2.begin(); i != ck2.end(); i++) {
    long long int x = i->second;
    ans += ((x) * (x - 1) / 2);
  }
  for (auto i = ck3.begin(); i != ck3.end(); i++) {
    long long int x = i->second;
    ans -= ((x) * (x - 1) / 2);
  }
  cout << ans << endl;
}
