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

using i64 = int64_t;

int main(){
    int n;
    while(cin >> n, n != 0){
        vector<i64> v;
        i64 sum = 0;
        for(int i=0;i<n;++i){
            i64 tmp;
            cin >> tmp;
            v.push_back(tmp);
            sum += tmp;
        }
        double mean = sum / (double)n;
        int ans = 0;
        for(int i=0;i<n;++i){
            if(v[i] <= mean)ans++;
        }

        cout << ans << endl;
    }

    return 0;
}

