#include <bits/stdc++.h>
#pragma GCC optimize("O3")
#pragma GCC target("sse4")
using namespace std;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
const int mod = 1e9 + 7;
const char nl = '\n';
map<pair<int, int>, long long> m;
map<long long, long long> cnt[2];
void solve() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    int x, y;
    cin >> x >> y;
    cnt[0][x]++;
    cnt[1][y]++;
    m[{x, y}]++;
  }
  long long ans = 0;
  for (int i = 0; i < 2; i++)
    for (auto it : cnt[i]) ans += it.second * (it.second - 1) / 2;
  for (auto it : m) ans -= it.second * (it.second - 1) / 2;
  cout << ans << nl;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  solve();
  return 0;
}
