#include <bits/stdc++.h>
using namespace std;
vector<long long> v;
vector<bool> used;
map<long long, long long> x, y;
map<pair<long long, long long>, long long> xy;
int main() {
  long long n;
  cin >> n;
  long long ans = 0;
  for (long long i = 0; i < n; i++) {
    long long a, b;
    cin >> a >> b;
    ans += x[a];
    ans += y[b];
    ans -= xy[{a, b}];
    x[a]++;
    y[b]++;
    xy[{a, b}]++;
  }
  cout << ans;
  return 0;
}
