#include <bits/stdc++.h>
using namespace std;
long long ncr(long long);
bool fn(const pair<long long, long long>& a,
        const pair<long long, long long>& b) {
  if (a.first == b.first) return (a.second < b.second);
  return a.first < b.first;
}
long long ncr(long long n) { return (n * (n - 1)) / 2; }
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long n;
  cin >> n;
  long long cnt = 0;
  vector<pair<long long, long long>> v;
  for (long long i = 0; i < n; i++) {
    long long x, y;
    cin >> x >> y;
    v.push_back(pair<long long, long long>(x, y));
  }
  sort(v.begin(), v.end(), fn);
  map<long long, long long> mp1;
  for (long long i = 0; i < n; i++) {
    mp1[v[i].first]++;
  }
  for (auto x : mp1) {
    if (x.second > 1) cnt += ncr(x.second);
  }
  map<long long, long long> mp;
  for (long long i = 0; i < n; i++) {
    mp[v[i].second]++;
  }
  for (auto x : mp) {
    if (x.second > 1) cnt += ncr(x.second);
  }
  map<pair<long long, long long>, long long> mp2;
  for (long long i = 0; i < n; i++) {
    mp2[pair<long long, long long>(v[i].first, v[i].second)]++;
  }
  for (auto x : mp2) {
    if (x.second > 1) cnt -= ncr(x.second);
  }
  cout << cnt;
  return 0;
}
