#include <bits/stdc++.h>
using namespace std;
const double PI = acos(-1.0);
const double EPS = 1e-10;
const int OO = 2147483647;
int dx[] = {1, -1, 0, 0};
int dy[] = {0, 0, -1, 1};
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  int n;
  cin >> n;
  map<pair<long long, long long>, long long> st;
  map<long long, long long> xs, ys;
  long long ans = 0;
  long long cnt = 0;
  while (n--) {
    int x, y;
    cin >> x >> y;
    ans += xs[x]++ + ys[y]++ - st[{x, y}]++;
  }
  cout << ans;
  return 0;
}
