#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vll = vector<ll>;
using vvll = vector<vll>;
using vb = vector<bool>;
using vd = vector<double>;
using vs = vector<string>;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using pdd = pair<double, double>;
using vpii = vector<pii>;
using vvpii = vector<vpii>;
using vpll = vector<pll>;
using vvpll = vector<vpll>;
using vpdd = vector<pdd>;
using vvpdd = vector<vpdd>;
ll gcd(ll a, ll b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
ll lcm(ll a, ll b) { return a * b / gcd(a, b); }
ll ceeel(ll n, ll a) {
  if (n % a == 0) return n / a;
  return n / a + 1;
}
ll power(ll x, ll y) {
  ll ans = 1;
  for (ll i = (0); i < (y); i++) {
    ans *= x;
  }
  return ans;
}
map<ll, vll> mpa, mpb;
map<ll, ll> temp;
void solve() {
  ll n;
  cin >> n;
  ll x, y;
  ll ans = 0;
  for (ll i = (0); i < (n); i++) {
    cin >> x >> y;
    {
      mpa[x].push_back((y));
      mpb[y].push_back((x));
    }
  }
  for (auto i : mpa) {
    vll a = i.second;
    ll p = a.size();
    ll q = a.size() - 1;
    ans += (p * q) / 2;
    for (ll i = (0); i < (a.size()); i++) {
      temp[a[i]]++;
    }
    for (auto j : temp) {
      ans -= ((j.second - 1) * (j.second)) / 2;
    }
    temp.clear();
  }
  for (auto i : mpb) {
    vll a = i.second;
    ll p = a.size();
    ll q = p - 1;
    ans += (p * q) / 2;
  }
  cout << ans;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  solve();
  return 0;
}
