#include <bits/stdc++.h>
using namespace std;

int main(){
    int n;
    
    while(1){
        cin >> n;
        if(n == 0) return 0;
        int a[n];
        for (int i = 0; i < n; i++) cin >> a[i];
        int goukei = 0;
        for(int i = 0; i < n; i++) goukei = goukei + a[i];
        int heikin = goukei / n;
        int ans=0;
        for(int i = 0; i < n; i++){
            if(a[i] <= heikin) ans++;
        }
        cout << ans << endl;
    }
    return 0;
}
