/* package whatever; // don't place package name! */
import java.util.*;
import java.lang.*;
import java.io.*;
/* Name of the class has to be "Main" only if the class is public. */
class Ideone
{
{
// your code goes here
Scanner sc
= new Scanner
(System.
in); int n = sc.nextInt();
int arr[] = new int[n];
for(int i=0; i<n; i++){
int val = sc.nextInt();
arr[i] = val;
}
int maxFrequency=0;
for(int i=0;i<n;i++){
int count=0;
for(int j=0;j<n;j++){
if(arr[i]==arr[j])
count++;
}
if(count>maxFrequency){
maxFrequency = count;
}
}
int operations = n - maxFrequency;
System.
out.
println("The minimum number of operations required to make all the elements equal:" + operations
); }
}
LyogcGFja2FnZSB3aGF0ZXZlcjsgLy8gZG9uJ3QgcGxhY2UgcGFja2FnZSBuYW1lISAqLwoKaW1wb3J0IGphdmEudXRpbC4qOwppbXBvcnQgamF2YS5sYW5nLio7CmltcG9ydCBqYXZhLmlvLio7CgovKiBOYW1lIG9mIHRoZSBjbGFzcyBoYXMgdG8gYmUgIk1haW4iIG9ubHkgaWYgdGhlIGNsYXNzIGlzIHB1YmxpYy4gKi8KY2xhc3MgSWRlb25lCnsKCXB1YmxpYyBzdGF0aWMgdm9pZCBtYWluIChTdHJpbmdbXSBhcmdzKSB0aHJvd3MgamF2YS5sYW5nLkV4Y2VwdGlvbgoJewoJCS8vIHlvdXIgY29kZSBnb2VzIGhlcmUKCQlTY2FubmVyIHNjID0gbmV3IFNjYW5uZXIoU3lzdGVtLmluKTsKCQlpbnQgbiA9IHNjLm5leHRJbnQoKTsKCQlpbnQgYXJyW10gPSBuZXcgaW50W25dOwoJCQoJCWZvcihpbnQgaT0wOyBpPG47IGkrKyl7CgkJCWludCB2YWwgPSBzYy5uZXh0SW50KCk7CgkJCWFycltpXSA9IHZhbDsKCQl9CgkJaW50IG1heEZyZXF1ZW5jeT0wOwoJCWZvcihpbnQgaT0wO2k8bjtpKyspewoJCQlpbnQgY291bnQ9MDsKCQkJZm9yKGludCBqPTA7ajxuO2orKyl7CgkJCQlpZihhcnJbaV09PWFycltqXSkK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