#include<iostream>
#include<cstring>
using namespace std;
int f[102],a[102];
int main(){
    int n,t;
    cin>>t;
    while(t--){
        memset(f,0,sizeof(f));
        cin>>n;
        int mi=200;
        for(int i=1;i<=n;i++){
            cin>>a[i];
            f[a[i]]++;
            mi=min(mi,a[i]);
        }
        cout<<n-f[mi]<<endl;
    }
}