#include <bits/stdc++.h>
using namespace std;
void solve() {
  long long x, y, n;
  long long cnt = 0, ans = 0;
  map<long long, long long> mp1, mp2;
  map<pair<long long, long long>, long long> mp;
  cin >> n;
  long long a[n];
  for (int i = 0; i < n; i++) {
    cin >> x >> y;
    ans += mp1[x]++;
    ans += mp2[y]++;
    ans -= mp[make_pair(x, y)]++;
  }
  cout << ans;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  int T = 1;
  while (T--) {
    solve();
  }
}
