#include <bits/stdc++.h>
using namespace std;
int INF = 2147483647;
int inf = -2147483648;
const double PI = acos(-1.0);
int main() {
  long long n;
  long long ans = 0;
  map<long long, long long> p;
  map<long long, long long> q;
  map<pair<long long, long long>, long long> pq;
  cin >> n;
  for (int i = 0; i < n; i++) {
    long long a, b;
    cin >> a >> b;
    ans += p[a]++;
    ans += q[b]++;
    ans -= pq[make_pair(a, b)]++;
  }
  cout << ans << endl;
  return 0;
}
