#include <bits/stdc++.h>
using namespace std;
template <class T>
bool chkmin(T& a, T b) {
  return a > b ? a = b, true : false;
}
template <class T>
bool chkmax(T& a, T b) {
  return a < b ? a = b, true : false;
}
template <class T>
void read(T& a) {
  char c = getchar_unlocked();
  T f = 1;
  a = 0;
  for (; !isdigit(c); c = getchar_unlocked())
    if (c == '-') f = -1;
  for (; isdigit(c); c = getchar_unlocked()) a = a * 10 + c - '0';
  a *= f;
}
const int maxN = 2e5 + 5;
int N;
pair<int, int> a[maxN];
map<int, int> f;
map<pair<int, int>, int> g;
int main() {
  read(N);
  for (int i = (1), _ = (N); i <= _; ++i) read(a[i].first), read(a[i].second);
  for (int i = (1), _ = (N); i <= _; ++i) f[a[i].first]++;
  long long ans = 0;
  for (map<int, int>::iterator it = f.begin(); it != f.end(); ++it)
    ans += (long long)it->second * (it->second - 1) / 2;
  f.clear();
  for (int i = (1), _ = (N); i <= _; ++i) f[a[i].second]++;
  for (map<int, int>::iterator it = f.begin(); it != f.end(); ++it)
    ans += (long long)it->second * (it->second - 1) / 2;
  for (int i = (1), _ = (N); i <= _; ++i) g[a[i]]++;
  for (map<pair<int, int>, int>::iterator it = g.begin(); it != g.end(); ++it)
    ans -= (long long)(it->second) * (it->second - 1) / 2;
  cout << ans << endl;
  return 0;
}
