#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1010;
const int MXLOG = 30;
const int mod = 1000000007;
const int inf = (1 << 30);
const long long infll = (1LL << 60);
int n;
map<int, int> x, y;
map<pair<int, int>, int> cnt;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  long long ans = 0;
  for (int i = 0; i < n; i++) {
    int a, b;
    cin >> a >> b;
    ans += x[a];
    ans += y[b];
    ans -= cnt[{a, b}];
    x[a]++;
    y[b]++;
    cnt[{a, b}]++;
  }
  cout << ans << endl;
}
