#include <bits/stdc++.h>
using namespace std;
map<long long, long long> x;
map<long long, long long> y;
map<pair<long long, long long>, long long> vis;
int main() {
  int n;
  cin >> n;
  long long a, b, cnt = 0;
  for (int i = 1; i <= n; i++) {
    cin >> a >> b;
    pair<long long, long long> c = make_pair((a), (b));
    cnt += x[a] + y[b] - vis[c];
    x[a]++;
    y[b]++;
    vis[c]++;
  }
  cout << cnt << endl;
}
