#include <bits/stdc++.h>
using namespace std;
vector<pair<int, int> > points;
map<pair<int, int>, int> contaRepetidos;
map<int, int> linhas;
map<int, int> colunas;
vector<int> l, c;
long long soma(int n) { return ((1 + n) * n) / 2; }
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int n;
  cin >> n;
  int repete = 0;
  for (int i = 0; i < n; ++i) {
    int x, y;
    cin >> x >> y;
    points.push_back({x, y});
    if (!contaRepetidos.count(points.back()))
      contaRepetidos[points.back()] = 1;
    else
      contaRepetidos[points.back()]++;
    if (!linhas.count(x)) {
      l.push_back(x);
      linhas[x] = 1;
    } else
      linhas[x]++;
    if (!colunas.count(y)) {
      c.push_back(y);
      colunas[y] = 1;
    } else
      colunas[y]++;
  }
  long long res = 0;
  for (auto &t : linhas) res += (long long)(t.second) * (t.second - 1) / 2;
  for (auto &t : colunas) res += (long long)(t.second) * (t.second - 1) / 2;
  for (auto &t : contaRepetidos)
    res -= (long long)(t.second) * (t.second - 1) / 2;
  cout << res << endl;
  return 0;
}
