#include <bits/stdc++.h>
using namespace std;
const int INF = (int)1e9;
const long long INF64 = (long long)1e18;
#pragma comment(linker, "/STACK:16777216")
#pragma warning(disable : 4786)
int Set(int N, int pos) { return N = N | (1 << pos); }
int Reset(int N, int pos) { return N = N & ~(1 << pos); }
bool check(int N, int pos) { return (bool)(N & (1 << pos)); }
const int mx = 1 << 29;
long long ans, sum, t, n, k, m;
pair<long long, long long> ar[200005];
map<int, int> am, bm;
map<pair<int, int>, int> cm;
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) {
    scanf("%lld", &ar[i].first);
    scanf("%lld", &ar[i].second);
    am[ar[i].first]++;
    bm[ar[i].second]++;
    cm[make_pair(ar[i].first, ar[i].second)]++;
  }
  for (int i = 1; i <= n; i++) {
    ans += am[ar[i].first] - 1;
    ans += bm[ar[i].second] - 1;
    ans -= cm[make_pair(ar[i].first, ar[i].second)] - 1;
  }
  ans /= 2;
  cout << ans << "\n";
  return 0;
}
