#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000007;
map<pair<long long, long long>, long long> m;
map<long long, long long> m1, m2;
signed main() {
  long long t = 1;
  cin >> t;
  long long ans = 0;
  while (t--) {
    long long a, b;
    cin >> a >> b;
    ans += m1[a]++ + m2[b]++ - m[{a, b}]++;
  }
  cout << ans;
  return 0;
}
