#include <bits/stdc++.h>
using namespace std;
int mod = 1000000007;
int main() {
  long long int t = 1;
  while (t--) {
    long long int n;
    cin >> n;
    vector<pair<int, int>> v;
    map<int, int> mx;
    map<int, int> my;
    for (int i = 0; i < n; i++) {
      int x, y;
      cin >> x >> y;
      v.push_back({x, y});
      mx[x]++;
      my[y]++;
    }
    sort(v.begin(), v.end());
    long long int ct = 1;
    long long int sum2 = 0;
    for (int i = 1; i < n; i++) {
      if (v[i - 1].first == v[i].first && v[i - 1].second == v[i].second) {
        ct++;
      } else {
        long long int p = ct;
        ct = 1;
        sum2 += ((p * (p - 1)) / 2);
      }
    }
    sum2 += ((ct * (ct - 1)) / 2);
    long long int sum = 0;
    for (auto it : mx) {
      long long int p = it.second;
      if (p >= 2) {
        sum += ((p * (p - 1)) / 2);
      }
    }
    for (auto it : my) {
      long long int p = it.second;
      if (p >= 2) {
        sum += ((p * (p - 1)) / 2);
      }
    }
    cout << sum - sum2 << endl;
  }
}
