#include <bits/stdc++.h>
using namespace std;
map<int, int> mp1;
map<int, int> mp2;
pair<int, int> arr[200010];
map<pair<int, int>, int> haha;
int main() {
  int n, x, y;
  long long ans = 0;
  cin >> n;
  for (int i = 0; i < n; ++i) {
    scanf("%d", &arr[i].first);
    ;
    scanf("%d", &arr[i].second);
    ;
    ++mp1[arr[i].first];
    ++mp2[arr[i].second];
    ++haha[{arr[i].first, arr[i].second}];
  }
  for (int i = 0; i < n; ++i) {
    ans += mp1[arr[i].first] - 1;
    if (mp1[arr[i].first] > 0) --mp1[arr[i].first];
    ans -= haha[{arr[i].first, arr[i].second}] - 1;
    if (haha[{arr[i].first, arr[i].second}] > 0)
      --haha[{arr[i].first, arr[i].second}];
    ans += mp2[arr[i].second] - 1;
    if (mp2[arr[i].second] > 0) --mp2[arr[i].second];
  }
  cout << ans << endl;
  return 0;
}
