func_code_string: #include <bits/stdc++.h>   using namespace std;   const int INF = 2000000009;   const int Max = 1000007;   const double PI = acos(-1.0);   long long nc2(long long n) { return (n * (n - 1)) / 2; }   map<long long, long long> mp1, mp2;   map<pair<long long, long long>, long long> mp3;   int main() {     long long i, j, k, l, temp, t, n, m, caseno = 0, ans;     string str;     while (cin >> n) {       mp1.clear();       mp2.clear();       mp3.clear();       for (i = 0; i < n; i++) {         cin >> j >> k;         if (mp1.find(j) == mp1.end()) mp1[j] = 0;         if (mp2.find(k) == mp2.end()) mp2[k] = 0;         mp1[j]++;         mp2[k]++;         pair<long long, long long> ttmp = make_pair(j, k);         if (mp3.find(ttmp) == mp3.end()) mp3[ttmp] = 0;         mp3[ttmp]++;       }       map<long long, long long>::iterator it;       ans = 0;       for (it = mp1.begin(); it != mp1.end(); ++it) {         ans += nc2(it->second);       }       for (it = mp2.begin(); it != mp2.end(); ++it) {         ans += nc2(it->second);       }       map<pair<long long, long long>, long long>::iterator itr;       for (itr = mp3.begin(); itr != mp3.end(); ++itr) {         ans -= nc2(itr->second);       }       cout << ans << endl;     }     return 0;   }   