#include <iostream>
#include <vector>
using namespace std;

int main() {
    int n;
    while (cin >> n, n) {
        vector<int> a(n);
        int sum = 0;
        for (int i = 0; i < n; ++i) cin >> a[i], sum += a[i];
        sum /= n;
        int num = 0;
        for (int i = 0; i < n; ++i) if (a[i] <= sum) ++num;
        cout << num << endl;
    }
}

