#include <bits/stdc++.h>
using namespace std;
int main() {
  map<long long, long long> maX, maY;
  map<pair<long long, long long>, long long> ma;
  set<long long> stX, stY;
  set<pair<long long, long long> > st;
  long long n, x, y;
  long long ans = 0;
  cin >> n;
  for (long long i = 0; i < n; ++i) {
    cin >> x >> y;
    maX[x]++;
    stX.insert(x);
    maY[y]++;
    stY.insert(y);
    ma[make_pair(x, y)]++;
    st.insert(make_pair(x, y));
  }
  set<long long>::iterator it;
  set<pair<long long, long long> >::iterator it1;
  for (it = stX.begin(); it != stX.end(); ++it) {
    ans += (maX[*it] * (maX[*it] - 1)) / 2;
  }
  for (it = stY.begin(); it != stY.end(); ++it) {
    ans += (maY[*it] * (maY[*it] - 1)) / 2;
  }
  for (it1 = st.begin(); it1 != st.end(); ++it1)
    ans -= (ma[*it1] * (ma[*it1] - 1)) / 2;
  cout << ans;
}
