#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
const int MAXN = (int)2e5 + 10;
const int mod = (int)1e9 + 7;
int arr[MAXN];
map<int, int> mp;
int a[MAXN], b[MAXN], c[MAXN];
int main() {
  int n, x, y;
  cin >> n;
  map<pair<int, int>, int> mp;
  map<int, int> a, b;
  long long ans = 0;
  for (int i = 0; i < n; ++i) {
    cin >> x >> y;
    mp[{x, y}]++;
    a[x]++;
    b[y]++;
  }
  for (auto x : a) {
    ans += (long long)x.second * (x.second - 1) / 2;
  }
  for (auto x : b) {
    ans += (long long)x.second * (x.second - 1) / 2;
  }
  for (auto x : mp) {
    ans -= (long long)x.second * (x.second - 1) / 2;
  }
  cout << ans << endl;
  return 0;
}
