#include <bits/stdc++.h>
using namespace std;
map<int, int> a, b;
map<pair<int, int>, int> q;
void test() {
  freopen("in.txt", "w", stdout);
  cout << "200000\n";
  for (int i = 0; i < 200000; i++) cout << "100000 21023123\n";
}
int main() {
  int n, x, y;
  long long ans = 0;
  cin >> n;
  while (n--) {
    cin >> x >> y;
    pair<int, int> w = pair<int, int>(x, y);
    ans += a[x] + b[y] - q[w];
    a[x]++;
    b[y]++;
    q[w]++;
  }
  cout << ans;
}
