#include <iostream>
using namespace std;
typedef long long ll;
void f(int n){
    // Your code here!
    ll s[n];
    ll tot=0;
    for(int i=0;i<n;i++){
        cin>>s[i];
        tot+=s[i];
    }
    ll ans=0;
    for(int i=0;i<n;i++){
        if(tot/n>=s[i])ans++;
    }
    cout<<ans<<endl;
}
int main(void){
    while(true){
        int N;
        cin>>N;
        if(N==0)break;
        f(N);
    }
    return 0;
}

