#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int minSteps(vector<int>&a){
int n = a.size();
sort(a.begin(), a.end());
int steps = 0;
for(int i = n-1 ; i>0 ; i--){
if(a[i]>a[i-1]){
steps += (n-i);
}
}
return steps;
}
int main(){
vector<int> a = {886,777};
cout << minSteps(a) << endl;
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8dmVjdG9yPgojaW5jbHVkZSA8YWxnb3JpdGhtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKaW50IG1pblN0ZXBzKHZlY3RvcjxpbnQ+JmEpewogICAgaW50IG4gPSBhLnNpemUoKTsKICAgIHNvcnQoYS5iZWdpbigpLCBhLmVuZCgpKTsKICAgIGludCBzdGVwcyA9IDA7CiAgICBmb3IoaW50IGkgPSBuLTEgOyBpPjAgOyBpLS0pewogICAgICAgIGlmKGFbaV0+YVtpLTFdKXsKICAgICAgICAgICAgc3RlcHMgKz0gKG4taSk7CiAgICAgICAgfQoKICAgIH0KICAgIHJldHVybiBzdGVwczsKfQppbnQgbWFpbigpewogICAgdmVjdG9yPGludD4gYSA9IHs4ODYsNzc3fTsKICAgIGNvdXQgPDwgbWluU3RlcHMoYSkgPDwgZW5kbDsKICAgIHJldHVybiAwOwp9