#include <bits/stdc++.h>

using namespace std;

void solve(int n){

    vector<int> a(n);

    for(int i = 0; i < n; i++){
        cin >> a[i];
    }

    long long sum = accumulate(a.begin(), a.end(), 0);
    double mean = sum / (double)n;

    int ans = 0;
    for(int i = 0; i < n; i++){
        if(a[i] <= mean){
            ans++;
        }
    }

    cout << ans << endl;

    return;
}

int main(){

    int n;
    while(cin >> n, n){
        solve(n);
    }

    return 0;
}
