#include <iostream>
using namespace std;
int main(void){
    int i,n,sum,cnt;
    int a[10000];
    
    while(1){
        cin >> n ;
        if(n == 0) break;
        
        sum = 0;
        
        for(i = 0;i < n;i++){
            cin >> a[i];
            sum += a[i];
        }
       // cout << sum;
        sum = sum / n;
        //cout << " " << sum << " ";
        cnt = 0;
        for(i = 0;i< n;i++){
            if(a[i] <= sum) cnt++;
        }
        
        cout << cnt << endl;
    }
}

