#include <bits/stdc++.h>
using namespace std;
void fastInOut() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL), cout.tie(NULL);
}
int dx[] = {0, 0, 1, -1, -1, -1, 1, 1};
int dy[] = {1, -1, 0, 0, -1, 1, -1, 1};
int main() {
  fastInOut();
  int n, a, b;
  cin >> n;
  long long fin = 0;
  map<int, int> x, y;
  map<pair<int, int>, int> rep;
  for (int i = 0; i < n; ++i) {
    cin >> a >> b;
    fin += x[a];
    fin += y[b];
    fin -= rep[make_pair(a, b)];
    x[a]++;
    y[b]++;
    rep[make_pair(a, b)]++;
  }
  cout << fin;
}
