#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  long long n;
  cin >> n;
  unordered_map<long long, long long> X;
  unordered_map<long long, long long> Y;
  vector<pair<long long, long long> > arr;
  map<pair<long long, long long>, long long> s;
  for (long long i = 0; i < n; i++) {
    long long x, y;
    cin >> x >> y;
    arr.emplace_back(x, y);
    X[x]++;
    Y[y]++;
    s[{x, y}]++;
  }
  long long ans = 0;
  for (long long i = 0; i < n; i++) {
    long long x = arr[i].first;
    long long y = arr[i].second;
    ans += X[x] - 1;
    ans += Y[y] - 1;
    X[x]--;
    Y[y]--;
    ans -= s[{x, y}] - 1;
    s[{x, y}]--;
  }
  cout << ans << '\n';
  return 0;
}
