#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n;
  std::vector<long long int> hr;
  vector<long long int> vr;
  vector<pair<long long int, long long int>> v;
  long long int a, b;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a >> b;
    hr.push_back(a);
    vr.push_back(b);
    v.push_back({a, b});
  }
  sort(v.begin(), v.end());
  sort(hr.begin(), hr.end());
  sort(vr.begin(), vr.end());
  long long int x = 0, y = 0, c = 0;
  long long int temp = 1;
  for (int i = 1; i < n; i++) {
    temp = 1;
    while (hr[i] == hr[i - 1] && i < n) {
      ++i;
      temp++;
    }
    x += ((temp * (temp - 1)) / 2);
  }
  for (int i = 1; i < n; i++) {
    temp = 1;
    while (vr[i] == vr[i - 1] && i < n) {
      ++i;
      temp++;
    }
    y += ((temp * (temp - 1)) / 2);
  }
  for (int i = 1; i < n; i++) {
    temp = 1;
    while (v[i].first == v[i - 1].first && v[i].second == v[i - 1].second &&
           i < n) {
      ++i;
      temp++;
    }
    c += ((temp * (temp - 1)) / 2);
  }
  cout << x + y - c;
}
