#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int N;
  cin >> N;
  map<int, long long> m1, m2;
  map<pair<int, int>, long long> m3;
  for (int i = 1; i <= N; i++) {
    int x, y;
    cin >> x >> y;
    m1[x]++, m2[y]++, m3[{x, y}]++;
  }
  long long ans = 0;
  for (map<int, long long>::iterator it = m1.begin(); it != m1.end(); it++) {
    ans += it->second * (it->second - 1) / 2;
  }
  for (map<int, long long>::iterator it = m2.begin(); it != m2.end(); it++) {
    ans += it->second * (it->second - 1) / 2;
  }
  for (map<pair<int, int>, long long>::iterator it = m3.begin(); it != m3.end();
       it++) {
    if (it->second > 1) ans -= it->second * (it->second - 1) / 2;
  }
  cout << ans << endl;
}
